Skip to content

Commit

Permalink
Remove heap warnings when using buffered finalisation
Browse files Browse the repository at this point in the history
The allocation of pages for the finaliser buffer is done from within the
STW pause. This can cause the heap to grow if lots of objects are
enqueued for finalisation in a single GC and can cause spurious warnings
to be printed to stderr.
  • Loading branch information
jacob-hughes committed Apr 17, 2024
1 parent 1422e27 commit fd7ce82
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2069,9 +2069,11 @@ GC_API void GC_CALL GC_enable(void)
LOCK();
GC_ASSERT(GC_dont_gc != 0); /* ensure no counter underflow */
GC_dont_gc--;
#ifndef BUFFERED_FINALIZATION
if (!GC_dont_gc && GC_heapsize > GC_heapsize_on_gc_disable)
WARN("Heap grown by %" WARN_PRIuPTR " KiB while GC was disabled\n",
(GC_heapsize - GC_heapsize_on_gc_disable) >> 10);
#endif
UNLOCK();
}

Expand Down

0 comments on commit fd7ce82

Please sign in to comment.