* 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.
+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.
+
2010-05-31 Ivan Maidanski <ivmai@mail.ru> (really Alexander Belchenko)
* include/cord.h: Fix typos.
# 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;
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);
* Copyright 1996-1999 by Silicon Graphics. All rights reserved.
* Copyright 1999 by Hewlett-Packard Company. All rights reserved.
* Copyright (C) 2007 Free Software Foundation, Inc
+ * Copyright (c) 2000-2010 by Hewlett-Packard Development Company.
*
* THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
* OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
/* Enable incremental/generational collection. Not advisable unless */
/* dirty bits are available or most heap objects are pointer-free */
/* (atomic) or immutable. Don't use in leak finding mode. Ignored if */
-/* GC_dont_gc is true. Only the generational piece of this is */
+/* GC_dont_gc is non-zero. Only the generational piece of this is */
/* functional if GC_parallel is TRUE or if GC_time_limit is */
/* GC_TIME_UNLIMITED. Causes thread-local variant of GC_gcj_malloc() */
/* to revert to locked allocation. Must be called before any such */
LPVOID /* lpParameter */, DWORD /* dwCreationFlags */,
LPDWORD /* lpThreadId */);
- GC_API void WINAPI GC_ExitThread(DWORD /* dwExitCode */);
+# ifndef DECLSPEC_NORETURN
+ /* Typically defined in winnt.h. */
+# define DECLSPEC_NORETURN /* empty */
+# endif
+
+ GC_API DECLSPEC_NORETURN void WINAPI GC_ExitThread(
+ DWORD /* dwExitCode */);
# if !defined(_WIN32_WCE) && !defined(__CEGCC__)
# if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) \
void * /* arglist */, unsigned /* initflag */,
unsigned * /* thrdaddr */);
+ /* Note: _endthreadex() is not currently marked as no-return in */
+ /* VC++ and MinGW headers, so we don't mark it neither. */
GC_API void GC_CALL GC_endthreadex(unsigned /* retval */);
# endif /* !_WIN32_WCE */
}
}
- GC_API void WINAPI GC_ExitThread(DWORD dwExitCode)
+ GC_API DECLSPEC_NORETURN void WINAPI GC_ExitThread(DWORD dwExitCode)
{
GC_unregister_my_thread();
ExitThread(dwExitCode);