[Gc] Minor fixes

Ivan Maidanski ivmai at mail.ru
Thu Oct 30 09:21:02 PST 2008


Hi!

This patch does the following:
- removes unused GC_PUSH_ALL() definition together with GC_true_func() (this eliminates "declared function never used" warning) in "mark.c" file;
- removes a comment (for already removed piece of code) in GC_push_stack_for() ("win32_threads.c" file);
- adds missing "ndef MSWINCE" guard for the last GC_may_be_in_stack() call in GC_get_next_stack() ("win32_threads.c" file);
- replaces "GC_get_stack_min(current_min-1)" with "GC_get_stack_min(current_min)"
(same as it had been before "GC stack problem on Win32") in GC_get_next_stack() ("win32_threads.c" file).

PS. I don't know whether GC could be built for WinCE.

Bye.
-------------- next part --------------
diff -ru bdwgc/mark.c updated/bdwgc/mark.c
--- bdwgc/mark.c	2008-10-28 17:43:13.000000000 +0300
+++ updated/bdwgc/mark.c	2008-10-30 18:04:22.961848800 +0300
@@ -1303,16 +1303,6 @@
 
 # ifndef SMALL_CONFIG
 
-#ifdef PARALLEL_MARK
-    /* Break up root sections into page size chunks to better spread 	*/
-    /* out work.							*/
-    STATIC GC_bool GC_true_func(struct hblk *h) { return TRUE; }
-#   define GC_PUSH_ALL(b,t) GC_push_selected(b,t,GC_true_func,GC_push_all);
-#else
-#   define GC_PUSH_ALL(b,t) GC_push_all(b,t);
-#endif
-
-
 void GC_push_conditional(ptr_t bottom, ptr_t top, GC_bool all)
 {
     if (all) {
diff -ru bdwgc/win32_threads.c updated/bdwgc/win32_threads.c
--- bdwgc/win32_threads.c	2008-10-29 12:56:33.000000000 +0300
+++ updated/bdwgc/win32_threads.c	2008-10-30 18:12:08.169378300 +0300
@@ -939,9 +939,6 @@
 #       endif
       } /* ! current thread */
 
-      /* If got sp value seems to be correct (at least, less than the	*/
-      /* bottom of the stack) then do its further validation by quick	*/
-      /* probing the memory region at it.				*/
       /* Set stack_min to the lowest address in the thread stack, 	*/
       /* taking advantage of the old value to avoid slow traversals	*/
       /* of large stacks.						*/
@@ -1093,9 +1090,12 @@
     /* Get the minimum address of the found stack by probing its memory	*/
     /* region starting from the last known minimum (if set).		*/
       if (*plast_stack_min == ADDR_LIMIT
-        || !GC_may_be_in_stack(*plast_stack_min)) {
+#	 ifndef MSWINCE
+	   || !GC_may_be_in_stack(*plast_stack_min)
+#	 endif
+         ) {
         /* Unsafe to start from last value.	*/
-        *lo = GC_get_stack_min(current_min-1);
+        *lo = GC_get_stack_min(current_min);
       } else {
         /* Use last value value to optimize search for min address */
     	*lo = GC_get_stack_min(*plast_stack_min);


More information about the Gc mailing list