2009-12-08 Ivan Maidanski <ivmai@mail.ru>
authorivmai <ivmai>
Tue, 8 Dec 2009 19:45:29 +0000 (19:45 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:52 +0000 (21:06 +0400)
* tests/test.c (reverse_test): Comment out a check for MSWIN32
(when determing BIG value) assuming outdated win32S.
* tests/test.c (reverse_test): Rename to reverse_test_inner;
change the declaration (to be of GC_fn_type); call itself thru
GC_call_with_gc_active() if the argument is zero.
* tests/test.c (reverse_test): New function added calling
reverse_test_inner thru GC_do_blocking (to test GC_do_blocking and
GC_call_with_gc_active).

ChangeLog
tests/test.c

index 6faecfe..f6091d4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-12-08  Ivan Maidanski <ivmai@mail.ru>
+
+       * tests/test.c (reverse_test): Comment out a check for MSWIN32
+       (when determing BIG value) assuming outdated win32S.
+       * tests/test.c (reverse_test): Rename to reverse_test_inner;
+       change the declaration (to be of GC_fn_type); call itself thru
+       GC_call_with_gc_active() if the argument is zero.
+       * tests/test.c (reverse_test): New function added calling
+       reverse_test_inner thru GC_do_blocking (to test GC_do_blocking and
+       GC_call_with_gc_active).
+
 2009-12-08  Ivan Maidanski <ivmai@mail.ru> (with input from Marcos Dione)
 
        * doc/README.macros (IGNORE_DYNAMIC_LOADING, PLATFORM_ANDROID):
index 49cfd24..fad6d5a 100644 (file)
@@ -519,7 +519,7 @@ struct {
  * Repeatedly reverse lists built out of very different sized cons cells.
  * Check that we didn't lose anything.
  */
-void reverse_test(void)
+void *GC_CALLBACK reverse_test_inner(void *data)
 {
     int i;
     sexpr b;
@@ -527,7 +527,13 @@ void reverse_test(void)
     sexpr d;
     sexpr e;
     sexpr *f, *g, *h;
-#   if defined(MSWIN32) || defined(MACOS)
+
+    if (data == 0) {
+      /* This stack frame is not guaranteed to be scanned. */
+      return GC_call_with_gc_active(reverse_test_inner, (void*)(word)1);
+    }
+
+#   if /*defined(MSWIN32) ||*/ defined(MACOS)
       /* Win32S only allows 128K stacks */
 #     define BIG 1000
 #   else
@@ -630,6 +636,13 @@ void reverse_test(void)
 #   endif
     *(volatile void **)&b = 0;
     *(volatile void **)&c = 0;
+    return 0;
+}
+
+void reverse_test(void)
+{
+    /* Test GC_do_blocking/GC_call_with_gc_active. */
+    (void)GC_do_blocking(reverse_test_inner, 0);
 }
 
 #undef a