]> granicus.if.org Git - gc/commitdiff
2008-01-29 Hans Boehm <Hans.Boehm@hp.com> (with help from Manuel Serrano)
authorhboehm <hboehm>
Tue, 29 Jan 2008 19:24:58 +0000 (19:24 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:42 +0000 (21:06 +0400)
* mark.c (GC_push_next_marked): correct comment.
* Makefile.direct: document NO_PROC_STAT.
* include/private/gcconfig.h: Accomodate NO_PROC_STAT.

ChangeLog
Makefile.direct
include/private/gcconfig.h
mark.c

index 8f25ec6d7d2ab5d10fccf8e9357420ee1accc6e8..026d052192896704c1ba80439218848d4076af27 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-29  Hans Boehm <Hans.Boehm@hp.com>  (with help from Manuel Serrano)
+       
+       * mark.c (GC_push_next_marked): correct comment.
+       * Makefile.direct: document NO_PROC_STAT.
+       * include/private/gcconfig.h: Accomodate NO_PROC_STAT.
+
 2008-01-10  Hans Boehm <Hans.Boehm@hp.com>
        
        * include/gc_version.h, configure.ac, doc/README:
index d9c5af1a0d5017bca1c2dd85c48b0cc5e3c1d2a8..765217f825235c3b010f83ed2def8776410f3974 100644 (file)
@@ -318,6 +318,8 @@ HOSTCFLAGS=$(CFLAGS)
 #   required for applications that store pointers in mmapped segments without
 #   informaing the collector.  But it typically performs poorly, especially
 #   since it will scan inactive but cached NPTL thread stacks completely.
+# -DNO_PROC_STAT Causes the collector to avoid relying on Linux'
+#   /proc/self/stat.
 #
 
 CXXFLAGS= $(CFLAGS) 
index 86b86a77b3bb4cdb1fb4b750b0eac59107c19afc..3a0f4523d658aac544a6fc0269b2bc09a89a3d4d 100644 (file)
  * If STACKBOTTOM is defined, then it's value will be used directly as the
  * stack base.  If LINUX_STACKBOTTOM is defined, then it will be determined
  * with a method appropriate for most Linux systems.  Currently we look
- * first for __libc_stack_end, and if that fails read it from /proc.
+ * first for __libc_stack_end (currently only id USE_LIBC_PRIVATES is
+ * defined), and if that fails read it from /proc.  (If USE_LIBC_PRIVATES
+ * is not defined and NO_PROC_STAT is defined, we revert to HEURISTIC2.)
  * If either of the last two macros are defined, then STACKBOTTOM is computed
  * during collector startup using one of the following two heuristics:
  * HEURISTIC1:  Take an address inside GC_init's frame, and round it up to
 #   endif
 # endif
 
+#if defined(LINUX_STACKBOTTOM) && defined(NO_PROC_STAT) \
+    && !defined(USE_LIBC_PRIVATES)
+    /* This combination will fail, since we have no way to get */
+    /* the stack base. Use HEURISTIC2 instead.                 */
+#   undef LINUX_STACKBOTTOM
+#   define HEURISTIC2
+    /* This may still fail on some architectures like IA64.    */
+    /* We tried ...                                            */
+#endif
+
 #if defined(LINUX) && defined(USE_MMAP)
     /* The kernel may do a somewhat better job merging mappings etc.   */
     /* with anonymous mappings.                                                */
diff --git a/mark.c b/mark.c
index 3e5c46d1b054ae3bab6a12580675c1acf65c841e..a82b7f06fedc6c5f831fcaaa736e389fc76eb4a4 100644 (file)
--- a/mark.c
+++ b/mark.c
@@ -1798,7 +1798,8 @@ GC_bool GC_block_was_dirty(struct hblk *h, hdr *hhdr)
 }
 #endif /* SMALL_CONFIG */
 
-/* Similar to GC_push_next_marked, but return address of next block    */
+/* Similar to GC_push_marked, but skip over unallocated blocks */
+/* and return address of next plausible block.                 */
 struct hblk * GC_push_next_marked(struct hblk *h)
 {
     hdr * hhdr = HDR(h);