fn format_header(v: Word, p: *const Word,
                   f: &mut fmt::Formatter) -> fmt::Result {
    let arity = primary::header::get_arity(v);
    let h_tag = primary::header::get_tag(v);

    match h_tag {
      primary::header::TAG_HEADER_TUPLE =>
        if p.is_null() {
          write!(f, "Tuple[{}]", arity)
        } else {
          unsafe { LTerm::format_tuple(p, f) }
        },
//      primary::header::TAG_HEADER_BIGNEG => write!(f, "BigNeg"),
//      primary::header::TAG_HEADER_BIGPOS => write!(f, "BigPos"),
      primary::header::TAG_HEADER_REF => write!(f, "Ref"),
      primary::header::TAG_HEADER_FUN => write!(f, "Fun"),
      primary::header::TAG_HEADER_FLOAT => write!(f, "Float"),
//      primary::header::TAG_HEADER_EXPORT => write!(f, "Export"),
//      primary::header::TAG_HEADER_REFCBIN => write!(f, "RefcBin"),
//      primary::header::TAG_HEADER_HEAPBIN => write!(f, "HeapBin"),
//      primary::header::TAG_HEADER_SUBBIN => write!(f, "SubBin"),
      primary::header::TAG_HEADER_HEAPOBJ => unsafe {
        let ho_ptr = p.offset(1);
        let hoclass = *(ho_ptr) as *const HeapObjClass;
        // Starting word of the heap object (the primary header word) becomes
        // `this` pointer for the heapobject, hence passing `p`.
        let s = ((*hoclass).fmt_str)(p) ;
        write!(f, "{}", s)
      },
      primary::header::TAG_HEADER_EXTPID => write!(f, "ExtPid"),
      primary::header::TAG_HEADER_EXTPORT => write!(f, "ExtPort"),
      primary::header::TAG_HEADER_EXTREF => write!(f, "ExtRef"),

      _ => panic!("Unexpected header tag {} value {}",
                  h_tag, primary::get_value(v))
    }
  }
/// Attempt to display contents of a tagged header word and the words which
/// follow it. Arg `p` if not null is used to fetch the following memory words
/// and display more detail.
Attempt to display contents of a tagged header word and the words which
follow it. Arg `p` if not null is used to fetch the following memory words
and display more detail.
Attempt to display contents of a tagged header word and the words which follow it . Arg ` p ` if not null is used to fetch the following memory words and display more detail .
fn format_header(v: Word, p: *const Word,
                   f: &mut fmt::Formatter) -> fmt::Result {
    let arity = primary::header::get_arity(v);
    let h_tag = primary::header::get_tag(v);
    match h_tag {
      primary::header::TAG_HEADER_TUPLE =>
        if p.is_null() {
          write!(f, "Tuple[{}]", arity)
        } else {
          unsafe { LTerm::format_tuple(p, f) }
        },
//      primary::header::TAG_HEADER_BIGNEG => write!(f, "BigNeg"),
//      primary::header::TAG_HEADER_BIGPOS => write!(f, "BigPos"),
      primary::header::TAG_HEADER_REF => write!(f, "Ref"),
      primary::header::TAG_HEADER_FUN => write!(f, "Fun"),
      primary::header::TAG_HEADER_FLOAT => write!(f, "Float"),
//      primary::header::TAG_HEADER_EXPORT => write!(f, "Export"),
//      primary::header::TAG_HEADER_REFCBIN => write!(f, "RefcBin"),
//      primary::header::TAG_HEADER_HEAPBIN => write!(f, "HeapBin"),
//      primary::header::TAG_HEADER_SUBBIN => write!(f, "SubBin"),
      primary::header::TAG_HEADER_HEAPOBJ => unsafe {
        let ho_ptr = p.offset(1);
        let hoclass = *(ho_ptr) as *const HeapObjClass;
        // Starting word of the heap object (the primary header word) becomes
        // `this` pointer for the heapobject, hence passing `p`.
        let s = ((*hoclass).fmt_str)(p) ;
        write!(f, "{}", s)
      },
      primary::header::TAG_HEADER_EXTPID => write!(f, "ExtPid"),
      primary::header::TAG_HEADER_EXTPORT => write!(f, "ExtPort"),
      primary::header::TAG_HEADER_EXTREF => write!(f, "ExtRef"),
      _ => panic!("Unexpected header tag {} value {}",
                  h_tag, primary::get_value(v))
    }
  }
fn format_header ( v : Word , p : * const Word , f : & mut fmt :: Formatter ) -> fmt :: Result { let arity = primary :: header :: get_arity ( v ) ; let h_tag = primary :: header :: get_tag ( v ) ; match h_tag { primary :: header :: TAG_HEADER_TUPLE => if p . is_null ( ) { write ! ( f " " arity ) } else { unsafe { LTerm :: format_tuple ( p , f ) } } , //      primary::header::TAG_HEADER_BIGNEG => write!(f, "BigNeg"), //      primary::header::TAG_HEADER_BIGPOS => write!(f, "BigPos"), primary :: header :: TAG_HEADER_REF => write ! ( f " " ) , primary :: header :: TAG_HEADER_FUN => write ! ( f " " ) , primary :: header :: TAG_HEADER_FLOAT => write ! ( f " " ) , //      primary::header::TAG_HEADER_EXPORT => write!(f, "Export"), //      primary::header::TAG_HEADER_REFCBIN => write!(f, "RefcBin"), //      primary::header::TAG_HEADER_HEAPBIN => write!(f, "HeapBin"), //      primary::header::TAG_HEADER_SUBBIN => write!(f, "SubBin"), primary :: header :: TAG_HEADER_HEAPOBJ => unsafe { let ho_ptr = p . offset ( 1 ) ; let hoclass = * ( ho_ptr ) as * const HeapObjClass ; // Starting word of the heap object (the primary header word) becomes // `this` pointer for the heapobject, hence passing `p`. let s = ( ( * hoclass ) . fmt_str ) ( p ) ; write ! ( f " " s ) } , primary :: header :: TAG_HEADER_EXTPID => write ! ( f " " ) , primary :: header :: TAG_HEADER_EXTPORT => write ! ( f " " ) , primary :: header :: TAG_HEADER_EXTREF => write ! ( f " " ) , _ => panic ! ( " " h_tag primary get_value ( v ) ) } }
Attempt to display contents of a tagged header word and the words which
follow it.
Attempt to display contents of a tagged header word and the words which follow it .
v
Word
p
*const Word
f
&mut fmt::Formatter