[Gc] Typos fix and some more

Ivan Maidanski ivmai at mail.ru
Fri Feb 6 13:09:44 PST 2009


Hi!

Today I've been tracking differences between latest boehm-gc from gcc-4.4 (forked from gc6.6) and gc6.8 to find out whether there's something not fixed yet in gc v7. Nothing really valuable found (most changes present in GC v7.1+).

Changes:
- typos fixed in pthread_stop_world.c, Makefile.dj;
- GC_SOLARIS_PTHREADS is replaced with GC_SOLARIS_THREADS in Makefile, Makefile.direct;
- "gc.h" is included at the beginning of backgraph.c, gcj_mlc.c, gc_pmark.h files (useful when gc_config.h[.in] is used);
- external _MIPS_SIM_ABI32 symbol is replaced with _ABIO32 in mips_sgi_mach_dep.s;

Plus, I've done some refinements to GC_register_finalizer() comment (for things, in my opinion, not quite clearly stated) in gc.h.

Bye.
-------------- next part --------------
diff -ru bdwgc/Makefile updated/bdwgc/Makefile
--- bdwgc/Makefile	2008-11-11 15:19:44.000000000 +0300
+++ updated/bdwgc/Makefile	2009-02-06 19:05:32.000000000 +0300
@@ -67,12 +67,8 @@
 #   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.
-# -DGC_SOLARIS_THREADS enables support for Solaris (thr_) threads.
-#   (Clients should also define GC_SOLARIS_THREADS and then include
-#   gc.h before performing thr_ or dl* or GC_ operations.)
+# -DGC_SOLARIS_THREADS enables support for Solaris pthreads.
 #   Must also define -D_REENTRANT.
-# -DGC_SOLARIS_PTHREADS enables support for Solaris pthreads.
-#   (Internally this define GC_SOLARIS_THREADS as well.)
 # -DGC_IRIX_THREADS enables support for Irix pthreads.  See README.irix.
 # -DGC_HPUX_THREADS enables support for HP/UX 11 pthreads.
 #   Also requires -D_REENTRANT or -D_POSIX_C_SOURCE=199506L. See README.hp.
diff -ru bdwgc/Makefile.direct updated/bdwgc/Makefile.direct
--- bdwgc/Makefile.direct	2008-11-11 15:21:32.000000000 +0300
+++ updated/bdwgc/Makefile.direct	2009-02-06 19:05:58.000000000 +0300
@@ -74,9 +74,7 @@
 # interception can be used on a few platforms.
 # -DGC_THREADS should set the appropriate one of the below macros,
 #   except -DGC_WIN32_PTHREADS, which must be set explicitly.
-# -DGC_SOLARIS_PTHREADS enables support for Solaris pthreads.
-#   (Clients should also define GC_SOLARIS_THREADS and then include
-#   gc.h before performing thr_ or dl* or GC_ operations.)
+# -DGC_SOLARIS_THREADS enables support for Solaris pthreads.
 #   Must also define -D_REENTRANT.
 # -DGC_IRIX_THREADS enables support for Irix pthreads.  See README.irix.
 # -DGC_HPUX_THREADS enables support for HP/UX 11 pthreads.
diff -ru bdwgc/Makefile.dj updated/bdwgc/Makefile.dj
--- bdwgc/Makefile.dj	2008-11-11 15:38:40.000000000 +0300
+++ updated/bdwgc/Makefile.dj	2009-02-06 19:10:46.000000000 +0300
@@ -84,9 +84,9 @@
 # -DJAVA_FINALIZATION makes it somewhat safer to finalize objects out of
 #   order by specifying a nonstandard finalization mark procedure  (see
 #   finalize.c).  Objects reachable from finalizable objects will be marked
-#   in a sepearte postpass, and hence their memory won't be reclaimed.
+#   in a separate postpass, and hence their memory won't be reclaimed.
 #   Not recommended unless you are implementing a language that specifies
-#   these semantics.  Since 5.0, determines only only the initial value
+#   these semantics.  Since 5.0, determines only the initial value
 #   of GC_java_finalization variable.
 # -DFINALIZE_ON_DEMAND causes finalizers to be run only in response
 #   to explicit GC_invoke_finalizers() calls.
diff -ru bdwgc/backgraph.c updated/bdwgc/backgraph.c
--- bdwgc/backgraph.c	2008-11-09 12:51:32.000000000 +0300
+++ updated/bdwgc/backgraph.c	2009-02-06 18:09:40.000000000 +0300
@@ -24,6 +24,8 @@
  * a growing space leak.
  */
 
+#include "gc.h"	/* For configuration information. */
+
 #ifdef MAKE_BACK_GRAPH
 
 #define MAX_IN	10	/* Maximum in-degree we handle directly */
diff -ru bdwgc/gcj_mlc.c updated/bdwgc/gcj_mlc.c
--- bdwgc/gcj_mlc.c	2008-11-08 03:29:55.000000000 +0300
+++ updated/bdwgc/gcj_mlc.c	2009-02-06 19:09:50.000000000 +0300
@@ -14,6 +14,8 @@
  */
 /* Boehm, July 31, 1995 5:02 pm PDT */
 
+#include "gc.h"	/* For configuration information. */
+
 #ifdef GC_GCJ_SUPPORT
 
 /*
diff -ru bdwgc/include/gc.h updated/bdwgc/include/gc.h
--- bdwgc/include/gc.h	2008-11-25 19:24:18.000000000 +0300
+++ updated/bdwgc/include/gc.h	2009-02-06 20:55:06.000000000 +0300
@@ -677,10 +677,14 @@
 	/* All but the last finalizer registered for an object  */
 	/* is ignored.						*/
 	/* Finalization may be removed by passing 0 as fn.	*/
-	/* Finalizers are implicitly unregistered just before   */
-	/* they are invoked.					*/
+	/* Finalizers are implicitly unregistered when they are	*/
+	/* enqueued for finalization (i.e. become ready to be	*/
+	/* finalized).						*/
 	/* The old finalizer and client data are stored in	*/
-	/* *ofn and *ocd.					*/ 
+	/* *ofn and *ocd.  (ofn and/or ocd may be NULL.		*/
+	/* The allocation lock is held while *ofn and *ocd are	*/
+	/* updated.  In case of error (no memory to register	*/
+	/* new finalizer), *ofn and *ocd remain unchanged.)	*/
 	/* Fn is never invoked on an accessible object,		*/
 	/* provided hidden pointers are converted to real 	*/
 	/* pointers only if the allocation lock is held, and	*/
@@ -690,8 +694,10 @@
 	/* a signal, the object may be left with no		*/
 	/* finalization, even if neither the old nor new	*/
 	/* finalizer were NULL.					*/
-	/* Obj should be the non-NULL starting address of an 	*/
-	/* object allocated by GC_malloc or friends.		*/
+	/* Obj should be the starting address of an object	*/
+	/* allocated by GC_malloc or friends. Obj may also be	*/
+	/* NULL or point to something outside GC heap (in this	*/
+	/* case, fn is ignored, *ofn and *ocd are set to NULL).	*/
 	/* Note that any garbage collectable object referenced	*/
 	/* by cd will be considered accessible until the	*/
 	/* finalizer is invoked.				*/
@@ -1093,7 +1099,8 @@
 #endif
   /*
    * All threads must be created using GC_CreateThread or GC_beginthreadex,
-   * or must explicitly call GC_register_my_thread,
+   * or must explicitly call GC_register_my_thread
+   * (and call GC_unregister_my_thread before thread termination),
    * so that they will be recorded in the thread table.
    * For backwards compatibility, it is possible to build the GC
    * with GC_DLL defined, and to call GC_use_DllMain().
@@ -1102,9 +1109,7 @@
    *
    * Currently the collector expects all threads to fall through and
    * terminate normally, or call GC_endthreadex() or GC_ExitThread,
-   * so that the thread is properly unregistered.  (An explicit call
-   * to GC_unregister_my_thread() should also work, but risks unregistering
-   * the thread twice.)
+   * so that the thread is properly unregistered.
    */
    GC_API HANDLE WINAPI GC_CreateThread(
       LPSECURITY_ATTRIBUTES lpThreadAttributes,
diff -ru bdwgc/include/private/gc_pmark.h updated/bdwgc/include/private/gc_pmark.h
--- bdwgc/include/private/gc_pmark.h	2009-01-19 12:52:10.000000000 +0300
+++ updated/bdwgc/include/private/gc_pmark.h	2009-02-06 19:17:42.000000000 +0300
@@ -25,6 +25,8 @@
 #ifndef GC_PMARK_H
 # define GC_PMARK_H
 
+# include "gc.h"	/* For configuration */
+
 # if defined(KEEP_BACK_PTRS) || defined(PRINT_BLACK_LIST)
 #   include "dbg_mlc.h"
 # endif
diff -ru bdwgc/mips_sgi_mach_dep.s updated/bdwgc/mips_sgi_mach_dep.s
--- bdwgc/mips_sgi_mach_dep.s	2005-10-11 03:33:34.000000000 +0400
+++ updated/bdwgc/mips_sgi_mach_dep.s	2009-02-06 19:12:22.000000000 +0300
@@ -24,7 +24,7 @@
 #   endif
     SAVE_GP(GPOFF)
     REG_S 	ra,RAOFF(sp)
-#   if (_MIPS_SIM == _MIPS_SIM_ABI32)
+#   if (_MIPS_SIM == _ABIO32)
     	call_push($2)
     	call_push($3)
 #   endif
diff -ru bdwgc/pthread_stop_world.c updated/bdwgc/pthread_stop_world.c
--- bdwgc/pthread_stop_world.c	2009-02-01 13:20:42.000000000 +0300
+++ updated/bdwgc/pthread_stop_world.c	2009-02-06 18:03:26.000000000 +0300
@@ -538,7 +538,7 @@
     	ABORT("Cannot set SIG_THR_RESTART handler");
     }
 
-    /* Initiialize suspend_handler_mask. It excludes SIG_THR_RESTART. */
+    /* Initialize suspend_handler_mask. It excludes SIG_THR_RESTART. */
       if (sigfillset(&suspend_handler_mask) != 0) ABORT("sigfillset() failed");
       GC_remove_allowed_signals(&suspend_handler_mask);
       if (sigdelset(&suspend_handler_mask, SIG_THR_RESTART) != 0)


More information about the Gc mailing list