alloc: tune the code to collect instead of expanding the heap if
there are many finalizers and we reclaimed some memory from cleaning
the finalization queue (should fix Mono bugs #71001 and #70701).
(Apply commit
a43aba7 from 'mono_libgc' branch)
* alloc.c (last_fo_entries, last_bytes_finalized): New static
variable.
* alloc.c (GC_collect_or_expand): Test GC_fo_entries delta (in case
of non-zero GC_bytes_finalized value) in the condition of toggling
garabage collection; update last_fo_entries and last_bytes_finalized
values.
* include/private/gc_priv.h (GC_fo_entries): Declare global variable
(for use in GC_collect_or_expand).