Skip to main content

shrink_thread_engine

Function shrink_thread_engine 

Source
pub fn shrink_thread_engine()
Expand description

Empty this thread’s engine roots to their smallest values, for a thread about to exit: the roots are leaked statics (no destructor at thread exit), so a thread that exits after reset_thread_engine leaves its rebuilt engine behind (~36 MB: the 2^17-slot interner, the three dump-sized States); after this, little more than the roots’ boxes. The thread must not convert again. The library API’s workers run it before they exit (retired, evicted, or after a panic); allocation-light, it needs no destructor and no unsafe (STABLE1 APIPOOL).