Skip to content

Commit

Permalink
Allow finalized_malloc to delay reclaiming disclaimed objects
Browse files Browse the repository at this point in the history
This flag allows the objects reachable only from a finalizable object to stay
marked until the next GC. This allows the disclaim function to enqueue
those objects to be finalised at some later point in time.
  • Loading branch information
jacob-hughes committed Apr 2, 2024
1 parent 10f5f84 commit ec983ff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fnlz_mlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ STATIC int GC_CALLBACK GC_finalized_disclaim(void *obj)
GC_ASSERT(!GC_find_leak);
(*fc->proc)((word *)obj + 1, fc->cd);
}
#ifdef DISCLAIM_MARK_CHILDREN
/* Prevent the objects reachable from the disclaimed object from */
/* being reclaimed immediately by marking them as live. Useful if */
/* the disclaim function queues objects to be finalised later. */
return 1;
#else
return 0;
#endif
}

STATIC void GC_register_disclaim_proc_inner(unsigned kind,
Expand Down

0 comments on commit ec983ff

Please sign in to comment.