summaryrefslogtreecommitdiff
path: root/gc_dlopen.c
diff options
context:
space:
mode:
authorivmai <ivmai>2010-07-13 09:44:01 +0000
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 21:06:54 +0400
commitd9f77cc8207154459a6ca71e3e6ca3f97696e31d (patch)
treed398dc37ef5da8e9d4fd3c1e5ae1f77b68be1393 /gc_dlopen.c
parent10c470bd6443d40dbc963e0543f80788e4293dce (diff)
downloadbdwgc-d9f77cc8207154459a6ca71e3e6ca3f97696e31d.tar.gz
2010-07-13 Ivan Maidanski <ivmai@mail.ru>
* 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.
Diffstat (limited to 'gc_dlopen.c')
-rw-r--r--gc_dlopen.c11
1 files changed, 6 insertions, 5 deletions
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);