pub fn emit_ref_map(&mut self) {
        let min_index = self.ref_list.iter().min().cloned().unwrap_or(0) / 8;
        let max_index = self.ref_list.iter().max().cloned().unwrap_or(0) / 8;
        let len = max_index - min_index + 1;
        let mut ref_map = vec![0; 8 + (len as usize + 7) / 8];
        ref_map[0..4].copy_from_slice(&min_index.to_le_bytes());
        ref_map[4..8].copy_from_slice(&max_index.to_le_bytes());
        for &offset in &self.ref_list {
            let index = (offset / 8 - min_index) as usize;
            ref_map[8 + index / 8] |= 1 << (index % 8);
        }

        self.emit(&[0x0F, 0x18, 0x05]);
        self.links.push(ChunkLink {
            pos: self.pos(),
            to: ChunkLinkTarget::Data(ref_map),
        });
        self.emit(&[0; 4]);
    }
// Emit a map for GC describing which stack frame slots are currently references.
// This should be called after each function invocation that can lead to GC.
Emit a map for GC describing which stack frame slots are currently references.
This should be called after each function invocation that can lead to GC.
Emit a map for GC describing which stack frame slots are currently references . This should be called after each function invocation that can lead to GC .
pub fn emit_ref_map(&mut self) {
        let min_index = self.ref_list.iter().min().cloned().unwrap_or(0) / 8;
        let max_index = self.ref_list.iter().max().cloned().unwrap_or(0) / 8;
        let len = max_index - min_index + 1;
        let mut ref_map = vec![0; 8 + (len as usize + 7) / 8];
        ref_map[0..4].copy_from_slice(&min_index.to_le_bytes());
        ref_map[4..8].copy_from_slice(&max_index.to_le_bytes());
        for &offset in &self.ref_list {
            let index = (offset / 8 - min_index) as usize;
            ref_map[8 + index / 8] |= 1 << (index % 8);
        }
        self.emit(&[0x0F, 0x18, 0x05]);
        self.links.push(ChunkLink {
            pos: self.pos(),
            to: ChunkLinkTarget::Data(ref_map),
        });
        self.emit(&[0; 4]);
    }
pub fn emit_ref_map ( & mut self ) { let min_index = self . ref_list . iter ( ) . min ( ) . cloned ( ) . unwrap_or ( 0 ) / 8 ; let max_index = self . ref_list . iter ( ) . max ( ) . cloned ( ) . unwrap_or ( 0 ) / 8 ; let len = max_index - min_index + 1 ; let mut ref_map = vec ! [ 0 8 ( len as usize 7 ) 8 ] ; ref_map [ 0 .. 4 ] . copy_from_slice ( & min_index . to_le_bytes ( ) ) ; ref_map [ 4 .. 8 ] . copy_from_slice ( & max_index . to_le_bytes ( ) ) ; for & offset in & self . ref_list { let index = ( offset / 8 - min_index ) as usize ; ref_map [ 8 + index / 8 ] |= 1 << ( index % 8 ) ; } self . emit ( & [ 0x0F , 0x18 , 0x05 ] ) ; self . links . push ( ChunkLink { pos : self . pos ( ) , to : ChunkLinkTarget :: Data ( ref_map ) , } ) ; self . emit ( & [ 0 ; 4 ] ) ; }
Emit a map for GC describing which stack frame slots are currently references.
Emit a map for GC describing which stack frame slots are currently references .
&mut self