]> granicus.if.org Git - gc/commitdiff
2011-04-16 Ivan Maidanski <ivmai@mail.ru>
authorivmai <ivmai>
Sat, 16 Apr 2011 09:32:15 +0000 (09:32 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:57 +0000 (21:06 +0400)
* 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.

ChangeLog
doc/README.macros
os_dep.c

index db1717adb351c3cc8e7f8059515487fdfa3ee191..2b1d0494c8faa37d051dd82fbbd5ae3301999bde 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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
index c9951178cc80c5448c42e5429ccf6415178d6467..c4a33c4c64cfa218212358f3c46407d338d68bb5 100644 (file)
@@ -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).
index 61ce2e2e7da8c19f4df5fb56f423b472d26d4e3e..b67e00ee84b9f66e4958b8ad7ad795da9a953a7f 100644 (file)
--- 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 <pthread.h>
   /* extern int pthread_getattr_np(pthread_t, pthread_attr_t *); */