Skip to content
  • Peter Zhu's avatar
    ed25f0bd
    Make env_clone compaction safe · ed25f0bd
    Peter Zhu authored
    The original order of events is:
    
    1. Allocate new_body.
    2. Peform memcpy into new_body.
    3. Create new_env using new_body.
    
    However, if GC compaction runs during step 3, then new_env would not
    have yet been created and objects on new_body could move but it would
    not be reference updated.
    
    This commit changes the order of the last two events.
    ed25f0bd
    Make env_clone compaction safe
    Peter Zhu authored
    The original order of events is:
    
    1. Allocate new_body.
    2. Peform memcpy into new_body.
    3. Create new_env using new_body.
    
    However, if GC compaction runs during step 3, then new_env would not
    have yet been created and objects on new_body could move but it would
    not be reference updated.
    
    This commit changes the order of the last two events.
Loading