From d9f77cc8207154459a6ca71e3e6ca3f97696e31d Mon Sep 17 00:00:00 2001 From: ivmai Date: Tue, 13 Jul 2010 09:44:01 +0000 Subject: 2010-07-13 Ivan Maidanski * gc_dlopen.c (disable_gc_for_dlopen): Update the comment. * gc_dlopen.c (dlopen): Ditto. * include/gc.h: Update copyright header. * include/gc.h (GC_enable_incremental): Refine the comment. * include/gc.h (DECLSPEC_NORETURN): Define macro as empty if missing (only for Win32). * include/gc.h (GC_ExitThread): Use DECLSPEC_NORETURN. * win32_threads.c (GC_ExitThread): Ditto. * include/gc.h (GC_endthreadex): Add a comment. --- gc_dlopen.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'gc_dlopen.c') diff --git a/gc_dlopen.c b/gc_dlopen.c index 268cd7ca..87d14c10 100644 --- a/gc_dlopen.c +++ b/gc_dlopen.c @@ -40,14 +40,13 @@ # endif /* Make sure we're not in the middle of a collection, and make */ - /* sure we don't start any. Returns previous value of GC_dont_gc. */ + /* sure we don't start any. */ /* This is invoked prior to a dlopen call to avoid synchronization */ /* issues. We can't just acquire the allocation lock, since startup */ - /* code in dlopen may try to allocate. */ - /* This solution risks heap growth in the presence of many dlopen */ - /* calls in either a multithreaded environment, or if the library */ + /* code in dlopen may try to allocate. This solution risks heap */ + /* growth (or, even, heap overflow) in the presence of many dlopen */ + /* calls in either a multi-threaded environment, or if the library */ /* initialization code allocates substantial amounts of GC'ed memory. */ - /* But I don't know of a better solution. */ static void disable_gc_for_dlopen(void) { DCL_LOCK_STATE; @@ -79,6 +78,8 @@ GC_API void * WRAP_DLFUNC(dlopen)(const char *path, int mode) void * result; # ifndef USE_PROC_FOR_LIBRARIES + /* Disable collections. This solution risks heap growth (or, */ + /* even, heap overflow) but there seems no better solutions. */ disable_gc_for_dlopen(); # endif result = (void *)REAL_DLFUNC(dlopen)(path, mode); -- cgit v1.2.1