]> granicus.if.org Git - gc/commit
alloc: tune the code to collect instead of expanding the heap if
authorPaolo Molaro <lupus@oddwiz.org>
Wed, 16 Feb 2005 21:23:39 +0000 (21:23 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 20 Jan 2012 21:57:23 +0000 (01:57 +0400)
commit88e92b418090bea0cfa36f017a52d7a29dd8807e
tree4c2f5de0e17a64f5280083932ef637ef4d3eac4e
parentfee74d32e33becbf84fdbc0834a2421da6996c01
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).
alloc.c
include/private/gc_priv.h