Skip to content
  • Damien George's avatar
    py/gc: Fix GC+thread bug where ptr gets lost because it's not computed. · 3653f514
    Damien George authored
    GC_EXIT() can cause a pending thread (waiting on the mutex) to be
    scheduled right away.  This other thread may trigger a garbage
    collection.  If the pointer to the newly-allocated block (allocated by
    the original thread) is not computed before the switch (so it's just left
    as a block number) then the block will be wrongly reclaimed.
    
    This patch makes sure the pointer is computed before allowing any thread
    switch to occur.
    3653f514