From: ivmai Date: Sat, 16 Apr 2011 09:32:15 +0000 (+0000) Subject: 2011-04-16 Ivan Maidanski X-Git-Tag: gc7_2alpha6~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5525068dbc6e9707f5bc703825bf1cfb76eeeb5f;p=gc 2011-04-16 Ivan Maidanski * 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. --- diff --git a/ChangeLog b/ChangeLog index db1717ad..2b1d0494 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-04-16 Ivan Maidanski + + * 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 * dbg_mlc.c (GC_generate_random_backtrace_no_gc): Fix a message diff --git a/doc/README.macros b/doc/README.macros index c9951178..c4a33c4c 100644 --- a/doc/README.macros +++ b/doc/README.macros @@ -82,12 +82,12 @@ GC_REQUIRE_WCSDUP Force GC to export GC_wcsdup() (the Unicode version 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). @@ -96,7 +96,7 @@ SUNOS5SIGS Solaris-like signal handling. This is probably misnamed, 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. @@ -551,6 +551,6 @@ PLATFORM_ANDROID Compile for Android NDK platform. 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). diff --git a/os_dep.c b/os_dep.c index 61ce2e2e..b67e00ee 100644 --- a/os_dep.c +++ b/os_dep.c @@ -1156,7 +1156,8 @@ GC_INNER word GC_page_size = 0; 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; @@ -1221,8 +1222,7 @@ GC_INNER word GC_page_size = 0; } #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 /* extern int pthread_getattr_np(pthread_t, pthread_attr_t *); */