diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2012-02-06 19:49:06 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2012-02-06 20:48:06 +0400 |
commit | c14335e44d3d325118cd9ecc7983e688581a1a49 (patch) | |
tree | 3a584683011801fad65ac2b5b020982c385594ce /alloc.c | |
parent | 5e9ebee3b24d9c6bd09a4540ac9127d235448cad (diff) | |
download | bdwgc-c14335e44d3d325118cd9ecc7983e688581a1a49.tar.gz |
Allow to exclude finalization support by GC_NO_FINALIZATION macro
* doc/README.macros (GC_NO_FINALIZATION): Document.
* alloc.c (GC_finish_collection): Do not call GC_finalize and
GC_print_finalization_stats if GC_NO_FINALIZATION.
* dbg_mlc.c (closure, GC_make_closure, GC_debug_invoke_finalizer,
OFN_UNSET, store_old, GC_debug_register_finalizer,
GC_debug_register_finalizer_no_order,
GC_debug_register_finalizer_unreachable,
GC_debug_register_finalizer_ignore_self): Do not define if
GC_NO_FINALIZATION.
* finalize.c: Skip all definitions if GC_NO_FINALIZATION.
* finalize.c (GC_call_with_alloc_lock): Move to misc.c.
* include/private/gc_priv.h (GC_INVOKE_FINALIZERS): Define to empty
if GC_NO_FINALIZATION.
* include/private/gc_priv.h (GC_notify_or_invoke_finalizers,
GC_push_finalizer_structures, GC_finalize,
GC_print_finalization_stats): Do not declare if GC_NO_FINALIZATION.
* mark_rts.c (GC_push_gc_structures): Do not call
GC_push_finalizer_structures if GC_NO_FINALIZATION.
* misc.c (GC_call_with_alloc_lock): Move from "finalize" module.
* tests/test.c (mktree): Do not declare "my_index" and "new_link"
local variables, do not update live_indicators_count, do not call
GC_REGISTER_FINALIZER, GC_GENERAL_REGISTER_DISAPPEARING_LINK,
GC_move_disappearing_link, GC_unregister_disappearing_link if
GC_NO_FINALIZATION.
* tests/test.c (check_heap_stats): Do not declare "still_live",
"late_finalize_count" local variables and do not check finalization
for failures if GC_NO_FINALIZATION.
Diffstat (limited to 'alloc.c')
-rw-r--r-- | alloc.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -841,7 +841,9 @@ STATIC void GC_finish_collection(void) /* The above just checks; it doesn't really reclaim anything. */ } - GC_finalize(); +# ifndef GC_NO_FINALIZATION + GC_finalize(); +# endif # ifdef STUBBORN_ALLOC GC_clean_changing_list(); # endif @@ -923,7 +925,9 @@ STATIC void GC_finish_collection(void) GET_TIME(done_time); /* A convenient place to output finalization statistics. */ - GC_print_finalization_stats(); +# ifndef GC_NO_FINALIZATION + GC_print_finalization_stats(); +# endif GC_log_printf("Finalize plus initiate sweep took %lu + %lu msecs\n", MS_TIME_DIFF(finalize_time,start_time), |