pub fn load_finalize(&mut self) -> Hopefully<module::Ptr> {
    let mut newmod = match self.mod_id {
      Some(mod_id) => module::Module::new(&mod_id),
      None => panic!("{}mod_id must be set at this point", module()),
    };

    // Move funs into new module
    {
      mem::swap(&mut self.funs, &mut newmod.funs);
      mem::swap(&mut self.code, &mut newmod.code);
      mem::swap(&mut self.lit_heap, &mut newmod.lit_heap);
      mem::swap(&mut self.lambdas, &mut newmod.lambdas);

//      unsafe {
//        disasm::disasm(&mod1.code, None);
//        //mod1.lit_heap.dump()
//      };
    }

    Ok(newmod)
  }
/// At this point loading is finished, and we create Erlang module and
/// return a reference counted pointer to it. VM (the caller) is responsible
/// for adding the module to its code registry.
At this point loading is finished, and we create Erlang module and
return a reference counted pointer to it. VM (the caller) is responsible
for adding the module to its code registry.
At this point loading is finished and we create Erlang module and return a reference counted pointer to it . VM ( the caller ) is responsible for adding the module to its code registry .
pub fn load_finalize(&mut self) -> Hopefully<module::Ptr> {
    let mut newmod = match self.mod_id {
      Some(mod_id) => module::Module::new(&mod_id),
      None => panic!("{}mod_id must be set at this point", module()),
    };
    // Move funs into new module
    {
      mem::swap(&mut self.funs, &mut newmod.funs);
      mem::swap(&mut self.code, &mut newmod.code);
      mem::swap(&mut self.lit_heap, &mut newmod.lit_heap);
      mem::swap(&mut self.lambdas, &mut newmod.lambdas);
//      unsafe {
//        disasm::disasm(&mod1.code, None);
//        //mod1.lit_heap.dump()
//      };
    }
    Ok(newmod)
  }
pub fn load_finalize ( & mut self ) -> Hopefully < module :: Ptr > { let mut newmod = match self . mod_id { Some ( mod_id ) => module :: Module :: new ( & mod_id ) , None => panic ! ( " " module ( ) ) , } ; // Move funs into new module { mem :: swap ( & mut self . funs , & mut newmod . funs ) ; mem :: swap ( & mut self . code , & mut newmod . code ) ; mem :: swap ( & mut self . lit_heap , & mut newmod . lit_heap ) ; mem :: swap ( & mut self . lambdas , & mut newmod . lambdas ) ; //      unsafe { //        disasm::disasm(&mod1.code, None); //        //mod1.lit_heap.dump() //      }; } Ok ( newmod ) }
At this point loading is finished, and we create Erlang module and
return a reference counted pointer to it.
At this point loading is finished and we create Erlang module and return a reference counted pointer to it .
&mut self