diff options
author | ivmai <ivmai> | 2011-06-30 15:43:44 +0000 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2011-07-26 21:07:00 +0400 |
commit | cea7d64af0f72989c690b0b0b8655a5f2d7ab2ad (patch) | |
tree | 0503f942088470083b0a292980ce05f8a35d860f /gc_dlopen.c | |
parent | 45a388771686fd791fc753fa877fc794b04d3c32 (diff) | |
download | bdwgc-cea7d64af0f72989c690b0b0b8655a5f2d7ab2ad.tar.gz |
2011-06-30 Ivan Maidanski <ivmai@mail.ru>
* dyn_load.c (GC_register_map_entries): Remove "count" local
variable as unused.
* gc_dlopen.c (disable_gc_for_dlopen): Define only if not
USE_PROC_FOR_LIBRARIES.
* malloc.c (calloc): Add parentheses around '&&' operator.
* mark.c (GC_noop_sink): New global variable (instead of a static
local variable inside GC_noop1).
* mark.c (GC_noop1): Use GC_noop_sink variable (to prevent
"variable set but not used" compiler warning).
* include/private/gcconfig.h (USE_PROC_FOR_LIBRARIES): Define only
if undefined yet.
* tests/smash_test.c (main): Don't dereference "p" local variable
if it is NULL.
* tests/staticrootslib.c (main): Ditto.
Diffstat (limited to 'gc_dlopen.c')
-rw-r--r-- | gc_dlopen.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/gc_dlopen.c b/gc_dlopen.c index e466d65c..f76230ec 100644 --- a/gc_dlopen.c +++ b/gc_dlopen.c @@ -43,16 +43,18 @@ /* dlopen calls in either a multi-threaded environment, or if the */ /* library initialization code allocates substantial amounts of GC'ed */ /* memory. */ -static void disable_gc_for_dlopen(void) -{ - DCL_LOCK_STATE; - LOCK(); - while (GC_incremental && GC_collection_in_progress()) { - GC_collect_a_little_inner(1000); +#ifndef USE_PROC_FOR_LIBRARIES + static void disable_gc_for_dlopen(void) + { + DCL_LOCK_STATE; + LOCK(); + while (GC_incremental && GC_collection_in_progress()) { + GC_collect_a_little_inner(1000); + } + ++GC_dont_gc; + UNLOCK(); } - ++GC_dont_gc; - UNLOCK(); -} +#endif /* Redefine dlopen to guarantee mutual exclusion with */ /* GC_register_dynamic_libraries. Should probably happen for */ |