[MLton-commit] r6398

Matthew Fluet fluet at mlton.org
Wed Feb 13 18:04:43 PST 2008


Fix some asserts
----------------------------------------------------------------------

U   mlton/trunk/runtime/gc/copy-thread.c

----------------------------------------------------------------------

Modified: mlton/trunk/runtime/gc/copy-thread.c
===================================================================
--- mlton/trunk/runtime/gc/copy-thread.c	2008-02-14 01:12:08 UTC (rev 6397)
+++ mlton/trunk/runtime/gc/copy-thread.c	2008-02-14 02:04:42 UTC (rev 6398)
@@ -49,8 +49,8 @@
    * restrictions can force the reserved to be slightly larger than
    * the used.
    */
-  /* assert (fromStack->reserved == fromStack->used); */
-  assert (fromStack->reserved >= fromStack->used);
+  /* assert (toStack->reserved == toStack->used); */
+  assert (toStack->reserved >= toStack->used);
   leave (s);
   if (DEBUG_THREADS)
     fprintf (stderr, FMTPTR" = GC_copyCurrentThread\n", (uintptr_t)toThread);
@@ -69,20 +69,14 @@
   enter (s);
   fromThread = (GC_thread)(p + offsetofThread (s));
   fromStack = (GC_stack)(objptrToPointer(fromThread->stack, s->heap.start));
-  /* The following assert is no longer true, since alignment
-   * restrictions can force the reserved to be slightly larger than
-   * the used.
-   */
-  /* assert (fromStack->reserved == fromStack->used); */
-  assert (fromStack->reserved >= fromStack->used);
   toThread = copyThread (s, fromThread, fromStack->used);
+  toStack = (GC_stack)(objptrToPointer(toThread->stack, s->heap.start));
   /* The following assert is no longer true, since alignment
    * restrictions can force the reserved to be slightly larger than
    * the used.
    */
-  toStack = (GC_stack)(objptrToPointer(toThread->stack, s->heap.start));
-  /* assert (fromStack->reserved == fromStack->used); */
-  assert (fromStack->reserved >= fromStack->used);
+  /* assert (toStack->reserved == toStack->used); */
+  assert (toStack->reserved >= toStack->used);
   leave (s);
   if (DEBUG_THREADS)
     fprintf (stderr, FMTPTR" = GC_copyThread ("FMTPTR")\n", 




More information about the MLton-commit mailing list