+2011-04-16 Ivan Maidanski <ivmai@mail.ru>
+
+ * os_dep.c (GC_get_main_stack_base): Try to use
+ pthread_attr_getstack first for Linux if THREADS.
+ * doc/README.macros (USE_GET_STACKBASE_FOR_MAIN): Adjust text
+ alignment.
+
2011-04-13 Ivan Maidanski <ivmai@mail.ru>
* dbg_mlc.c (GC_generate_random_backtrace_no_gc): Fix a message
These define arguments influence the collector configuration:
-FIND_LEAK Causes GC_find_leak to be initially set. This causes the
+FIND_LEAK Causes GC_find_leak to be initially set. This causes the
collector to assume that all inaccessible objects should have been
explicitly deallocated, and reports exceptions. Finalization and the test
program are not usable in this mode.
-GC_ABORT_ON_LEAK Causes the application to be terminated once leaked or
+GC_ABORT_ON_LEAK Causes the application to be terminated once leaked or
smashed (corrupted on use-after-free) objects are found (after printing the
information about that objects).
for Solaris2.X, HPUX, and DRSNX. Should probably be set for some other
platforms.
-PCR Set if the collector is being built as part of the Xerox Portable
+PCR Set if the collector is being built as part of the Xerox Portable
Common Runtime.
USE_COMPILER_TLS Assume the existence of __thread-style thread-local storage.
SN_TARGET_PS3 Compile for Sony PS/3.
USE_GET_STACKBASE_FOR_MAIN (Linux only) Use pthread_attr_getstack() instead
-of __libc_stack_end (or instead of any hard-coded value) for getting the
-primordial thread stack base (useful if the client modifies the program's
-address space).
+ of __libc_stack_end (or instead of any hard-coded value) for getting the
+ primordial thread stack base (useful if the client modifies the program's
+ address space).
ptr_t GC_get_main_stack_base(void)
{
ptr_t result; /* also used as "dummy" to get the approx. sp value */
-# if defined(LINUX) && defined(USE_GET_STACKBASE_FOR_MAIN) && !defined(NACL)
+# if defined(LINUX) && !defined(NACL) \
+ && (defined(USE_GET_STACKBASE_FOR_MAIN) || defined(THREADS))
pthread_attr_t attr;
void *stackaddr;
size_t size;
}
#endif /* !AMIGA, !BEOS, !OPENBSD, !OS2, !Windows */
-#if defined(GC_LINUX_THREADS) && !defined(HAVE_GET_STACK_BASE) \
- && !defined(NACL)
+#if defined(GC_LINUX_THREADS) && !defined(NACL)
# include <pthread.h>
/* extern int pthread_getattr_np(pthread_t, pthread_attr_t *); */