[MLton-commit] r4218

Matthew Fluet MLton@mlton.org
Mon, 14 Nov 2005 16:24:48 -0800


Cleaning up interface between GC and rest of runtime
----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml
U   mlton/branches/on-20050822-x86_64-branch/include/main.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c
D   mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/errno.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.h
A   mlton/branches/on-20050822-x86_64-branch/runtime/gc/done.h
D   mlton/branches/on-20050822-x86_64-branch/runtime/gc/exports.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/garbage-collection.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h
D   mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.c
D   mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/handler.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/init-world.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h
A   mlton/branches/on-20050822-x86_64-branch/runtime/gc/pack.h
D   mlton/branches/on-20050822-x86_64-branch/runtime/gc/platform.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/profiling.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/profiling.h
A   mlton/branches/on-20050822-x86_64-branch/runtime/gc/share.h
A   mlton/branches/on-20050822-x86_64-branch/runtime/gc/size.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/string.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/switch-thread.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/world.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/platform.h

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

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml	2005-11-15 00:24:38 UTC (rev 4218)
@@ -210,7 +210,6 @@
       val detectOverflow =
          _command_line_const "MLton.detectOverflow": bool = true;
       val eq = _prim "MLton_eq": 'a * 'a -> bool;
-      (* val errno = _import "MLton_errno": unit -> int; *)
       val installSignalHandler =
          _prim "MLton_installSignalHandler": unit -> unit;
       val safe = _command_line_const "MLton.safe": bool = true;

Modified: mlton/branches/on-20050822-x86_64-branch/include/main.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/include/main.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/include/main.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -10,6 +10,7 @@
 #define _MAIN_H_
 
 #define MLTON_GC_INTERNAL_TYPES
+#define MLTON_GC_INTERNAL_BASIS
 #include "platform.h"
 
 /* The label must be declared as weak because gcc's optimizer may prove that

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile	2005-11-15 00:24:38 UTC (rev 4218)
@@ -62,10 +62,10 @@
 	-Wmissing-noreturn -Wmissing-format-attribute \
 	-Wpacked \
 	-Wredundant-decls \
-	-Wnested-externs 
-#	-Wshadow \
-#	-Wmissing-prototypes \
-#	-Wmissing-declarations 
+	-Wnested-externs \
+	-Wmissing-prototypes \
+	-Wmissing-declarations 
+#	-Wshadow 
 OPTWARNFLAGS = $(WARNFLAGS) -Winline -Wdisabled-optimization 
 DEBUGWARNFLAGS = $(WARNFLAGS) -Wunused
 
@@ -165,7 +165,7 @@
 
 types.h: gen/gen-types.c util.h $(UTILOFILES)
 	rm -f types.h
-	$(CC) $(OPTCFLAGS) $(OPTWARNFLAGS) -Wno-inline -Wno-disabled-optimization -o gen-types gen/gen-types.c $(UTILOFILES)
+	$(CC) $(OPTCFLAGS) $(WARNFLAGS) -o gen-types gen/gen-types.c $(UTILOFILES)
 	./gen-types
 	rm -f gen-types
 
@@ -182,9 +182,9 @@
 # with -fno-strict-aliasing to prevent gcc from taking advantage of
 # this aspect of the C spec.
 basis/Real/%-gdb.o: basis/Real/%.c gdtoa/arith.h
-	$(CC) $(DEBUGCFLAGS) $(DEBUGWARNFLAGS) -Wno-redundant-decls -c -o $@ $<
+	$(CC) $(DEBUGCFLAGS) -c -o $@ $<
 basis/Real/%.o: basis/Real/%.c gdtoa/arith.h
-	$(CC) $(OPTCFLAGS) -O1 -fno-strict-aliasing $(OPTWARNFLAGS) -Wno-redundant-decls -c -o $@ $<
+	$(CC) $(OPTCFLAGS) -O1 -fno-strict-aliasing -c -o $@ $<
 
 %-gdb.o: %.c $(HFILES)
 	$(CC) $(DEBUGCFLAGS) -c -o $@ $<

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c	2005-11-15 00:24:38 UTC (rev 4218)
@@ -7,7 +7,7 @@
  */
 
 #define MLTON_GC_INTERNAL_TYPES
-#define MLTON_GC_INTERNAL_INTINF
+#define MLTON_GC_INTERNAL_BASIS
 #include "platform.h"
 
 enum {

Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/errno.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/errno.c	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/errno.c	2005-11-15 00:24:38 UTC (rev 4218)
@@ -1,5 +0,0 @@
-#include "platform.h"
-
-Int MLton_errno () {
-        return errno;
-}

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -14,4 +14,8 @@
 
 #endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
 
+#if (defined (MLTON_GC_INTERNAL_BASIS))
+
 pointer GC_alignFrontier (GC_state s, pointer p);
+
+#endif /* (defined (MLTON_GC_INTERNAL_BASIS)) */

Added: mlton/branches/on-20050822-x86_64-branch/runtime/gc/done.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/done.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/done.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -0,0 +1,9 @@
+/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
+ *    Jagannathan, and Stephen Weeks.
+ * Copyright (C) 1997-2000 NEC Research Institute.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ */
+
+void GC_done (GC_state s);

Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/gc/exports.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/exports.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/exports.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -1,18 +0,0 @@
-/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
- *    Jagannathan, and Stephen Weeks.
- * Copyright (C) 1997-2000 NEC Research Institute.
- *
- * MLton is released under a BSD-style license.
- * See the file MLton-LICENSE for details.
- */
-
-void GC_pack (GC_state s);
-void GC_unpack (GC_state s);
-
-void GC_share (GC_state s, pointer object);
-
-size_t GC_size (GC_state s, pointer root);
-
-
-int GC_init (GC_state s, int argc, char **argv);
-void GC_done (GC_state s);

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/garbage-collection.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/garbage-collection.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/garbage-collection.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -22,7 +22,12 @@
 static void ensureHasHeapBytesFree (GC_state s, 
                                     size_t oldGenBytesRequested,
                                     size_t nurseryBytesRequested);
+
+#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
+
+#if (defined (MLTON_GC_INTERNAL_BASIS))
+
 void GC_collect (GC_state s, size_t bytesRequested, bool force,
                  char *file, int line);
 
-#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
+#endif /* (defined (MLTON_GC_INTERNAL_BASIS)) */

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.c	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.c	2005-11-15 00:24:38 UTC (rev 4218)
@@ -109,3 +109,77 @@
   assert (isFrontierAligned (s, s->heap.nursery));
   assert (hasHeapBytesFree (s, oldGenBytesRequested, nurseryBytesRequested));
 }
+
+
+bool GC_getAmOriginal (GC_state s) {
+  return s->amOriginal;
+}
+void GC_setAmOriginal (GC_state s, bool b) {
+  s->amOriginal = b;
+}
+
+void GC_setMessages (GC_state s, bool b) {
+  s->controls.messages = b;
+}
+
+void GC_setSummary (GC_state s, bool b) {
+  s->controls.summary = b;
+}
+
+void GC_setRusageMeasureGC (GC_state s, bool b) {
+  s->controls.rusageMeasureGC = b;
+}
+
+void GC_setHashConsDuringGC (GC_state s, bool b) {
+  s->hashConsDuringGC = b;
+}
+
+struct rusage* GC_getRusageGCAddr (GC_state s) {
+  return &(s->cumulativeStatistics.ru_gc);
+}
+
+sigset_t* GC_getSignalsHandledAddr (GC_state s) {
+  return &(s->signalsInfo.signalsHandled);
+}
+
+sigset_t* GC_getSignalsPendingAddr (GC_state s) {
+  return &(s->signalsInfo.signalsPending);
+}
+
+void GC_setGCSignalHandled (GC_state s, bool b) {
+  s->signalsInfo.gcSignalHandled = b;
+}
+
+bool GC_getGCSignalPending (GC_state s) {
+  return (s->signalsInfo.gcSignalPending);
+}
+
+void GC_setGCSignalPending (GC_state s, bool b) {
+  s->signalsInfo.gcSignalPending = b;
+}
+
+void GC_setCallFromCHandlerThread (GC_state s, GC_thread t) {
+  objptr op = pointerToObjptr ((pointer)t, s->heap.start);
+  s->callFromCHandlerThread = op;
+}
+
+GC_thread GC_getCurrentThread (GC_state s) {
+  pointer p = objptrToPointer (s->currentThread, s->heap.start);
+  return (GC_thread)p;
+}
+
+GC_thread GC_getSavedThread (GC_state s) {
+  pointer p = objptrToPointer (s->savedThread, s->heap.start);
+  s->savedThread = BOGUS_OBJPTR;
+  return (GC_thread)p;
+}
+
+void GC_setSavedThread (GC_state s, GC_thread t) {
+  objptr op = pointerToObjptr ((pointer)t, s->heap.start);
+  s->savedThread = op;
+}
+
+void GC_setSignalHandlerThread (GC_state s, GC_thread t) {
+  objptr op = pointerToObjptr ((pointer)t, s->heap.start);
+  s->signalHandlerThread = op;
+}

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -76,3 +76,28 @@
                                    size_t nurseryBytesRequested);
 
 #endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
+
+#if (defined (MLTON_GC_INTERNAL_BASIS)) 
+
+bool GC_getAmOriginal (GC_state s);
+void GC_setAmOriginal (GC_state s, bool b);
+void GC_setMessages (GC_state s, bool b);
+void GC_setSummary (GC_state s, bool b);
+void GC_setRusageMeasureGC (GC_state s, bool b);
+void GC_setHashConsDuringGC (GC_state s, bool b);
+
+GC_thread GC_getCurrentThread (GC_state s);
+GC_thread GC_getSavedThread (GC_state s);
+void GC_setCallFromCHandlerThread (GC_state s, GC_thread thread);
+void GC_setSavedThread (GC_state s, GC_thread thread);
+void GC_setSignalHandlerThread (GC_state s, GC_thread thread);
+
+#endif /* (defined (MLTON_GC_INTERNAL_BASIS)) */
+
+struct rusage* GC_getRusageGCAddr (GC_state s);
+
+sigset_t* GC_getSignalsHandledAddr (GC_state s);
+sigset_t* GC_getSignalsPendingAddr (GC_state s);
+void GC_setGCSignalHandled (GC_state s, bool b);
+bool GC_getGCSignalPending (GC_state s);
+void GC_setGCSignalPending (GC_state s, bool b);

Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.c	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.c	2005-11-15 00:24:38 UTC (rev 4218)
@@ -1,80 +0,0 @@
-/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
- *    Jagannathan, and Stephen Weeks.
- * Copyright (C) 1997-2000 NEC Research Institute.
- *
- * MLton is released under a BSD-style license.
- * See the file MLton-LICENSE for details.
- */
-
-bool GC_getAmOriginal (GC_state s) {
-  return s->amOriginal;
-}
-void GC_setAmOriginal (GC_state s, bool b) {
-  s->amOriginal = b;
-}
-
-void GC_setMessages (GC_state s, bool b) {
-  s->controls.messages = b;
-}
-
-void GC_setSummary (GC_state s, bool b) {
-  s->controls.summary = b;
-}
-
-void GC_setRusageMeasureGC (GC_state s, bool b) {
-  s->controls.rusageMeasureGC = b;
-}
-
-void GC_setHashConsDuringGC (GC_state s, bool b) {
-  s->hashConsDuringGC = b;
-}
-
-struct rusage* GC_getRusageGCAddr (GC_state s) {
-  return &(s->cumulativeStatistics.ru_gc);
-}
-
-sigset_t* GC_getSignalsHandledAddr (GC_state s) {
-  return &(s->signalsInfo.signalsHandled);
-}
-
-sigset_t* GC_getSignalsPendingAddr (GC_state s) {
-  return &(s->signalsInfo.signalsPending);
-}
-
-void GC_setGCSignalHandled (GC_state s, bool b) {
-  s->signalsInfo.gcSignalHandled = b;
-}
-
-bool GC_getGCSignalPending (GC_state s) {
-  return (s->signalsInfo.gcSignalPending);
-}
-
-void GC_setGCSignalPending (GC_state s, bool b) {
-  s->signalsInfo.gcSignalPending = b;
-}
-
-void GC_setCallFromCHandlerThread (GC_state s, GC_thread t) {
-  objptr op = pointerToObjptr ((pointer)t, s->heap.start);
-  s->callFromCHandlerThread = op;
-}
-
-GC_thread GC_getCurrentThread (GC_state s) {
-  pointer p = objptrToPointer (s->currentThread, s->heap.start);
-  return (GC_thread)p;
-}
-
-GC_thread GC_getSavedThread (GC_state s) {
-  pointer p = objptrToPointer (s->savedThread, s->heap.start);
-  s->savedThread = BOGUS_OBJPTR;
-  return (GC_thread)p;
-}
-
-void GC_setSavedThread (GC_state s, GC_thread t) {
-  objptr op = pointerToObjptr ((pointer)t, s->heap.start);
-  s->savedThread = op;
-}
-
-void GC_setSignalHandlerThread (GC_state s, GC_thread t) {
-  objptr op = pointerToObjptr ((pointer)t, s->heap.start);
-  s->signalHandlerThread = op;
-}

Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -1,28 +0,0 @@
-/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
- *    Jagannathan, and Stephen Weeks.
- * Copyright (C) 1997-2000 NEC Research Institute.
- *
- * MLton is released under a BSD-style license.
- * See the file MLton-LICENSE for details.
- */
-
-bool GC_getAmOriginal (GC_state s);
-void GC_setAmOriginal (GC_state s, bool b);
-void GC_setMessages (GC_state s, bool b);
-void GC_setSummary (GC_state s, bool b);
-void GC_setRusageMeasureGC (GC_state s, bool b);
-void GC_setHashConsDuringGC (GC_state s, bool b);
-struct rusage* GC_getRusageGCAddr (GC_state s);
-
-GC_thread GC_getCurrentThread (GC_state s);
-GC_thread GC_getSavedThread (GC_state s);
-void GC_setCallFromCHandlerThread (GC_state s, GC_thread thread);
-void GC_setSavedThread (GC_state s, GC_thread thread);
-void GC_setSignalHandlerThread (GC_state s, GC_thread thread);
-
-sigset_t* GC_getSignalsHandledAddr (GC_state s);
-sigset_t* GC_getSignalsPendingAddr (GC_state s);
-void GC_setGCSignalHandled (GC_state s, bool b);
-bool GC_getGCSignalPending (GC_state s);
-void GC_setGCSignalPending (GC_state s, bool b);
-

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/handler.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/handler.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/handler.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -12,6 +12,11 @@
 
 #endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
 
+#if (defined (MLTON_GC_INTERNAL_BASIS))
+
 void GC_startSignalHandler (GC_state s);
 void GC_finishSignalHandler (GC_state s);
+
+#endif /* (defined (MLTON_GC_INTERNAL_BASIS)) */
+
 void GC_handler (GC_state s, int signum);

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/init-world.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/init-world.c	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/init-world.c	2005-11-15 00:24:38 UTC (rev 4218)
@@ -10,7 +10,6 @@
 /*                          Initialization                          */
 /* ---------------------------------------------------------------- */
 
-
 size_t sizeofInitialBytesLive (GC_state s) {
   uint32_t i;
   size_t numBytes;

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -12,3 +12,5 @@
                            char **argv, char **worldFile);
 
 #endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
+
+int GC_init (GC_state s, int argc, char **argv);

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -27,8 +27,8 @@
 
 #endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
 
-#if (defined (MLTON_GC_INTERNAL_INTINF))
+#if (defined (MLTON_GC_INTERNAL_BASIS))
 
 GC_header GC_intInfHeader (void);
 
-#endif /* (defined (MLTON_GC_INTERNAL_INTINF)) */
+#endif /* (defined (MLTON_GC_INTERNAL_BASIS)) */

Added: mlton/branches/on-20050822-x86_64-branch/runtime/gc/pack.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/pack.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/pack.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -0,0 +1,14 @@
+/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
+ *    Jagannathan, and Stephen Weeks.
+ * Copyright (C) 1997-2000 NEC Research Institute.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ */
+
+#if (defined (MLTON_GC_INTERNAL_BASIS))
+
+void GC_pack (GC_state s);
+void GC_unpack (GC_state s);
+
+#endif /* (defined (MLTON_GC_INTERNAL_BASIS)) */

Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/gc/platform.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/platform.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/platform.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -1,48 +0,0 @@
-/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
- *    Jagannathan, and Stephen Weeks.
- * Copyright (C) 1997-2000 NEC Research Institute.
- *
- * MLton is released under a BSD-style license.
- * See the file MLton-LICENSE for details.
- */
-
-/* ---------------------------------------------------------------- */
-/*                        Virtual Memory                            */
-/* ---------------------------------------------------------------- */
-
-/* GC_displayMem displays the virtual memory mapping to stdout.  
- * It is used to diagnose memory problems. 
- */
-void GC_displayMem (void);
-
-void *GC_mmapAnon (void *start, size_t length);
-void *GC_mmapAnon_safe (void *start, size_t length);
-void *GC_mmapAnon_safe_protect (void *start, size_t length, 
-                                size_t dead_low, size_t dead_high);
-void *GC_mremap (void *start, size_t oldLength, size_t newLength);
-void GC_release (void *base, size_t length);
-void GC_decommit (void *base, size_t length);
-
-size_t GC_pageSize (void);
-size_t GC_totalRam (void);
-size_t GC_availRam (void);
-
-
-/* ---------------------------------------------------------------- */
-/*                        Text Segment                              */
-/* ---------------------------------------------------------------- */
-
-void *GC_getTextEnd (void);
-void *GC_getTextStart (void);
-
-/* ---------------------------------------------------------------- */
-/*                        SigProf Handler                           */
-/* ---------------------------------------------------------------- */
-
-void GC_setSigProfHandler (struct sigaction *sa);
-
-/* ---------------------------------------------------------------- */
-/*                        Misc                                      */
-/* ---------------------------------------------------------------- */
-
-void GC_setCygwinUseMmap (bool b);

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/profiling.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/profiling.c	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/profiling.c	2005-11-15 00:24:38 UTC (rev 4218)
@@ -204,7 +204,7 @@
 }
 
 
-GC_profileData GC_profileNew (GC_state s) {
+GC_profileData GC_profileMalloc (GC_state s) {
   GC_profileData p;
   uint32_t profileMasterLength;
 
@@ -218,7 +218,7 @@
       (struct GC_profileStack *)
       (calloc_safe(profileMasterLength, sizeof(*(p->stack))));
   if (DEBUG_PROFILE)
-    fprintf (stderr, FMTPTR" = GC_profileNew ()\n", (uintptr_t)p);
+    fprintf (stderr, FMTPTR" = GC_profileMalloc ()\n", (uintptr_t)p);
   return p;
 }
 
@@ -342,7 +342,7 @@
 static void initProfilingTime (GC_state s) {
   struct sigaction sa;
 
-  s->profiling.data = GC_profileNew (s);
+  s->profiling.data = GC_profileMalloc (s);
   initTextSources (s);
   /*
    * Install catcher, which handles SIGPROF and calls MLton_Profile_inc.
@@ -399,7 +399,7 @@
     switch (s->profiling.kind) {
     case PROFILE_ALLOC:
     case PROFILE_COUNT:
-      s->profiling.data = GC_profileNew (s);
+      s->profiling.data = GC_profileMalloc (s);
       break;
     case PROFILE_NONE:
       die ("impossible PROFILE_NONE");

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/profiling.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/profiling.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/profiling.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -100,6 +100,8 @@
 
 #endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
 
+#if (defined (MLTON_GC_INTERNAL_BASIS))
+
 void GC_profileEnter (GC_state s);
 void GC_profileLeave (GC_state s);
 void GC_profileInc (GC_state s, size_t amount);
@@ -108,10 +110,13 @@
 GC_profileData GC_getProfileCurrent (GC_state s);
 void GC_setProfileCurrent (GC_state s, GC_profileData p);
 
-GC_profileData GC_profileNew (GC_state s);
+GC_profileData GC_profileMalloc (GC_state s);
 void GC_profileWrite (GC_state s, GC_profileData p, int fd);
 void GC_profileFree (GC_state s, GC_profileData p);
 
 void GC_profileDone (GC_state s);
 
+#endif /* (defined (MLTON_GC_INTERNAL_BASIS)) */
+
 void GC_handleSigProf (pointer pc);
+

Added: mlton/branches/on-20050822-x86_64-branch/runtime/gc/share.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/share.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/share.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -0,0 +1,13 @@
+/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
+ *    Jagannathan, and Stephen Weeks.
+ * Copyright (C) 1997-2000 NEC Research Institute.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ */
+
+#if (defined (MLTON_GC_INTERNAL_BASIS))
+
+void GC_share (GC_state s, pointer object);
+
+#endif /* (defined (MLTON_GC_INTERNAL_BASIS)) */

Added: mlton/branches/on-20050822-x86_64-branch/runtime/gc/size.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/size.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/size.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -0,0 +1,13 @@
+/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
+ *    Jagannathan, and Stephen Weeks.
+ * Copyright (C) 1997-2000 NEC Research Institute.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ */
+
+#if (defined (MLTON_GC_INTERNAL_BASIS))
+
+size_t GC_size (GC_state s, pointer root);
+
+#endif /* (defined (MLTON_GC_INTERNAL_BASIS)) */

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -75,7 +75,6 @@
 #if (defined (MLTON_GC_INTERNAL_FUNCS))
 
 static GC_sourceSeqIndex getStackTopFrameSourceSeqIndex (GC_state s, GC_stack stack);
-char* GC_sourceName (GC_state s, GC_sourceIndex i);
 
 static void sortSourceLabels (GC_state s);
 static void initTextSources (GC_state s);
@@ -83,3 +82,9 @@
 static void showSources (GC_state s);
 
 #endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
+
+#if (defined (MLTON_GC_INTERNAL_BASIS))
+
+char* GC_sourceName (GC_state s, GC_sourceIndex i);
+
+#endif /* (defined (MLTON_GC_INTERNAL_BASIS)) */

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/string.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/string.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/string.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -26,8 +26,8 @@
 
 #endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
 
-#if (defined (MLTON_GC_INTERNAL_INTINF))
+#if (defined (MLTON_GC_INTERNAL_BASIS))
 
 GC_header GC_stringHeader (void);
 
-#endif /* (defined (MLTON_GC_INTERNAL_INTINF)) */
+#endif /* (defined (MLTON_GC_INTERNAL_BASIS)) */

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/switch-thread.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/switch-thread.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/switch-thread.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -12,4 +12,8 @@
 
 #endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
 
+#if (defined (MLTON_GC_INTERNAL_BASIS))
+
 void GC_switchToThread (GC_state s, GC_thread t, size_t ensureBytesFree);
+
+#endif /* (defined (MLTON_GC_INTERNAL_BASIS)) */

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -40,8 +40,12 @@
 static size_t sizeofWeak (GC_state s);
 static size_t offsetofWeak (GC_state s);
 
+#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
+
+#if (defined (MLTON_GC_INTERNAL_BASIS))
+
 uint32_t GC_weakCanGet (GC_state s, pointer p);
 pointer GC_weakGet (GC_state s, pointer p);
 pointer GC_weakNew (GC_state s, GC_header header, pointer p);
 
-#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
+#endif /* (defined (MLTON_GC_INTERNAL_BASIS)) */

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/world.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/world.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/world.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -14,4 +14,8 @@
 
 #endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
 
+#if (defined (MLTON_GC_INTERNAL_BASIS))
+
 void GC_saveWorld (GC_state s, int fd);
+
+#endif /* (defined (MLTON_GC_INTERNAL_BASIS)) */

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc.c	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc.c	2005-11-15 00:24:38 UTC (rev 4218)
@@ -8,7 +8,6 @@
 
 #define MLTON_GC_INTERNAL_TYPES
 #define MLTON_GC_INTERNAL_FUNCS
-#define MLTON_GC_INTERNAL_INTINF
 #define MLTON_GC_INTERNAL_BASIS
 #include "platform.h"
 #include "gc/rusage.h"
@@ -33,7 +32,6 @@
 #include "gc/frame.c"
 #include "gc/garbage-collection.c"
 #include "gc/gc_state.c"
-#include "gc/gc_state_exports.c"
 #include "gc/generational.c"
 #include "gc/handler.c"
 #include "gc/hash-cons.c"

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -59,14 +59,14 @@
 #include "gc/sources.h"
 #include "gc/call-stack.h"
 #include "gc/profiling.h"
+#include "gc/gc_state.h"
 #include "gc/init-world.h"
 #include "gc/world.h"
 #include "gc/init.h"
+#include "gc/done.h"
 #include "gc/copy-thread.h"
-#include "gc/gc_state.h"
+#include "gc/pack.h"
+#include "gc/size.h"
+#include "gc/share.h"
 
-#include "gc/platform.h"
-#include "gc/gc_state_exports.h"
-#include "gc/exports.h"
-
 #endif /* _MLTON_GC_H_ */

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform.h	2005-11-14 23:03:16 UTC (rev 4217)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform.h	2005-11-15 00:24:38 UTC (rev 4218)
@@ -127,6 +127,46 @@
 int mkdir2 (const char *pathname, mode_t mode);
 
 /* ---------------------------------------------------------------- */
+/*                        Garbage Collector                         */
+/* ---------------------------------------------------------------- */
+
+/* ------------------------------------------------- */
+/*                Virtual Memory                     */
+/* ------------------------------------------------- */
+
+/* GC_displayMem displays the virtual memory mapping to stdout.  
+ * It is used to diagnose memory problems. 
+ */
+void GC_displayMem (void);
+
+void *GC_mmapAnon (void *start, size_t length);
+void *GC_mmapAnon_safe (void *start, size_t length);
+void *GC_mmapAnon_safe_protect (void *start, size_t length, 
+                                size_t dead_low, size_t dead_high);
+void *GC_mremap (void *start, size_t oldLength, size_t newLength);
+void GC_release (void *base, size_t length);
+void GC_decommit (void *base, size_t length);
+
+size_t GC_pageSize (void);
+size_t GC_totalRam (void);
+size_t GC_availRam (void);
+
+void GC_setCygwinUseMmap (bool b);
+
+/* ------------------------------------------------- */
+/*                Text Segment                       */
+/* ------------------------------------------------- */
+
+void *GC_getTextEnd (void);
+void *GC_getTextStart (void);
+
+/* ------------------------------------------------- */
+/*                SigProf Handler                    */
+/* ------------------------------------------------- */
+
+void GC_setSigProfHandler (struct sigaction *sa);
+
+/* ---------------------------------------------------------------- */
 /*                         MLton libraries                          */
 /* ---------------------------------------------------------------- */
 
@@ -184,15 +224,6 @@
 void Debug_leave (Pointer name);
 
 /* ------------------------------------------------- */
-/*                        GC                         */
-/* ------------------------------------------------- */
-
-void MLton_GC_setHashConsDuringGC (Int b);
-void MLton_GC_setMessages (Int b);
-void MLton_GC_setSummary (Int b);
-void MLton_GC_setRusageMeasureGC (Int b);
-
-/* ------------------------------------------------- */
 /*                     IEEEReal                      */
 /* ------------------------------------------------- */
 
@@ -258,10 +289,6 @@
 void MLton_bug (Pointer msg);
 
 Int MLton_errno (void);
-/* halt the machine */
-void MLton_exit (Int status);
-Word MLton_random (void);
-Word MLton_size (Pointer p);
 
 /* ---------------------------------- */
 /*           MLton.Platform           */
@@ -298,18 +325,6 @@
 extern Bool MLton_Platform_CygwinUseMmap;
 
 /* ---------------------------------- */
-/*           MLton.Profile            */
-/* ---------------------------------- */
-
-void MLton_Profile_Data_free (Pointer d);
-Pointer MLton_Profile_Data_malloc (void);
-void MLton_Profile_Data_write (Pointer data, Word fd);
-
-Pointer MLton_Profile_current (void);
-void MLton_Profile_done (void);
-void MLton_Profile_setCurrent (Pointer d);
-
-/* ---------------------------------- */
 /*           MLton.Process            */
 /* ---------------------------------- */
 
@@ -940,18 +955,6 @@
 int String_equal (char * s1, char * s2);
 
 /* ------------------------------------------------- */
-/*                      Thread                       */
-/* ------------------------------------------------- */
-
-Pointer Thread_current (void);
-void Thread_finishSignalHandler (void);
-void Thread_resetSignals (void);
-Pointer Thread_saved (void);
-void Thread_setSignalHandler (Pointer t);
-void Thread_startSignalHandler (void);
-void Thread_switchTo (Pointer t, Word ensureBytesFree);
-
-/* ------------------------------------------------- */
 /*                       Time                        */
 /* ------------------------------------------------- */