[MLton-commit] r4239
Matthew Fluet
MLton@mlton.org
Tue, 15 Nov 2005 20:07:55 -0800
Added inline keyword to GC functions.
On the whole, the x86_64 branch GC seems to be on par with the HEAD
branch. When bootstrapping from HEAD, the first two rounds of
compilation have the following GC statistics:
GC type time ms number bytes bytes/sec
------------- ------- ------- --------------- ---------------
copying 8,190 15 743,351,148 90,763,268
mark-compact 7,720 1 270,968,964 35,099,606
minor 40,490 84 2,324,098,348 57,399,315
total GC time: 57,320 ms (23.4%)
max pause: 7,840 ms
total allocated: 36,724,587,360 bytes
max live: 367,636,960 bytes
max semispace: 2,898,235,392 bytes
max stack size: 5,931,008 bytes
marked cards: 7,294,459
minor scanned: 2,479,793,968 bytes
minor skipped: 0 bytes
GC type time ms number bytes bytes/sec
------------- ------- ------- --------------- ---------------
copying 6,410 10 572,569,192 89,324,370
mark-compact 14,340 2 583,604,792 40,697,684
minor 38,960 70 2,381,812,548 61,134,817
total GC time: 60,880 ms (24.7%)
max pause: 8,710 ms
total allocated: 36,958,526,152 bytes
max live: 420,478,708 bytes
max semispace: 2,526,560,256 bytes
max stack size: 5,906,432 bytes
marked cards: 7,036,479
minor scanned: 2,283,542,764 bytes
minor skipped: 0 bytes
Both of these are using the HEAD runtime.
The another round of compilation gives the following GC statistics:
GC type time ms number bytes bytes/sec
------------- ------- ------- --------------- ---------------
copying 36,926 28 5,082,738,360 137,646,595
mark-compact 16,213 2 532,059,008 32,816,814
minor 40,058 99 2,587,561,848 64,595,379
total GC time: 94,885 ms (35.4%)
max pause: 10,088 ms
total allocated: 36,651,485,884 bytes
max live: 420,482,864 bytes
max semispace: 2,526,572,544 bytes
max stack size: 5,935,104 bytes
marked cards: 7,004,958
minor scanned: 2,173,534,208 bytes
There is obviously something bogus with the copying GC -- there's too
many of them and they seem to be copying way more data than they
should. There also seems to be an awful lot more minor GCs.
I suspect that some heap-sizing parameters got messed up in the
rewrite, since there doesn't appear to be a correctness problem.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/array-allocate.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/atomic.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/call-stack.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/call-stack.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/controls.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/copy-thread.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/current.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/dfs-mark.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/enter_leave.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/forward.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/garbage-collection.c
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.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/handler.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/hash-cons.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/invariant.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/new-object.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/object-size.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/objptr.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.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
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/rusage.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/switch-thread.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/thread.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/translate.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.h
----------------------------------------------------------------------
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-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -8,9 +8,9 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static size_t alignWithExtra (GC_state s, size_t bytes, size_t extra);
-static bool isFrontierAligned (GC_state s, pointer p);
-static pointer alignFrontier (GC_state s, pointer p);
+static inline size_t alignWithExtra (GC_state s, size_t bytes, size_t extra);
+static inline bool isFrontierAligned (GC_state s, pointer p);
+static inline pointer alignFrontier (GC_state s, pointer p);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/array-allocate.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/array-allocate.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/array-allocate.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -6,11 +6,11 @@
* See the file MLton-LICENSE for details.
*/
-#if (defined (MLTON_GC_INTERNAL_FUNCS))
+#if (defined (MLTON_GC_INTERNAL_BASIS))
pointer GC_arrayAllocate (GC_state s,
size_t ensureBytesFree,
GC_arrayLength numElements,
GC_header header);
-#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
+#endif /* (defined (MLTON_GC_INTERNAL_BASIS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -38,9 +38,9 @@
static inline GC_arrayLength getArrayLength (pointer a);
static inline GC_arrayCounter* getArrayCounterp (pointer a);
static inline GC_arrayCounter getArrayCounter (pointer a);
-static pointer indexArrayAtPointerIndex (GC_state s, pointer a,
- GC_arrayCounter arrayIndex,
- uint32_t pointerIndex);
+static inline pointer indexArrayAtPointerIndex (GC_state s, pointer a,
+ GC_arrayCounter arrayIndex,
+ uint32_t pointerIndex);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/atomic.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/atomic.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/atomic.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -8,7 +8,7 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static void beginAtomic (GC_state s);
-static void endAtomic (GC_state s);
+static inline void beginAtomic (GC_state s);
+static inline void endAtomic (GC_state s);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/call-stack.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/call-stack.c 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/call-stack.c 2005-11-16 04:07:42 UTC (rev 4239)
@@ -6,8 +6,8 @@
* See the file MLton-LICENSE for details.
*/
-static void numStackFramesAux (GC_state s,
- __attribute__ ((unused)) GC_frameIndex i) {
+void numStackFramesAux (GC_state s,
+ __attribute__ ((unused)) GC_frameIndex i) {
s->callStackState.numStackFrames++;
}
@@ -20,8 +20,7 @@
return s->callStackState.numStackFrames;
}
-static void callStackAux (GC_state s,
- GC_frameIndex i) {
+void callStackAux (GC_state s, GC_frameIndex i) {
if (DEBUG_CALL_STACK)
fprintf (stderr, "callStackAux ("FMTFI")\n", i);
s->callStackState.callStack[s->callStackState.numStackFrames] = i;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/call-stack.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/call-stack.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/call-stack.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -15,6 +15,14 @@
#endif /* (defined (MLTON_GC_INTERNAL_TYPES)) */
+#if (defined (MLTON_GC_INTERNAL_FUNCS))
+
+static inline void numStackFramesAux (GC_state s, GC_frameIndex i);
+static inline void callStackAux (GC_state s, GC_frameIndex i);
+
+#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
+
+
#if (defined (MLTON_GC_INTERNAL_BASIS))
uint32_t GC_numStackFrames (GC_state s);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -8,8 +8,8 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static void updateWeaksForCheneyCopy (GC_state s);
-static void swapHeapsForCheneyCopy (GC_state s);
+static inline void updateWeaksForCheneyCopy (GC_state s);
+static inline void swapHeapsForCheneyCopy (GC_state s);
static void majorCheneyCopyGC (GC_state s);
static void minorCheneyCopyGC (GC_state s);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/controls.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/controls.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/controls.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -50,7 +50,7 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static bool detailedGCTime (GC_state s);
-static bool needGCTime (GC_state s);
+static inline bool detailedGCTime (GC_state s);
+static inline bool needGCTime (GC_state s);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/copy-thread.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/copy-thread.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/copy-thread.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -8,7 +8,7 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static GC_thread copyThread (GC_state s, GC_thread from, size_t size);
+static inline GC_thread copyThread (GC_state s, GC_thread from, size_t size);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/current.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/current.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/current.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -8,9 +8,9 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static objptr getThreadCurrentObjptr (GC_state s);
-static GC_thread getThreadCurrent (GC_state s);
-static objptr getStackCurrentObjptr (GC_state s);
-static GC_stack getStackCurrent (GC_state s);
+static inline objptr getThreadCurrentObjptr (GC_state s);
+static inline GC_thread getThreadCurrent (GC_state s);
+static inline objptr getStackCurrentObjptr (GC_state s);
+static inline GC_stack getStackCurrent (GC_state s);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/dfs-mark.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/dfs-mark.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/dfs-mark.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -17,12 +17,12 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static bool isPointerMarked (pointer p);
-static bool isPointerMarkedByMode (pointer p, GC_markMode m);
+static inline bool isPointerMarked (pointer p);
+static inline bool isPointerMarkedByMode (pointer p, GC_markMode m);
static size_t dfsMarkByMode (GC_state s, pointer root,
GC_markMode mode, bool shouldHashCons);
-static void dfsMarkWithHashCons (GC_state s, objptr *opp);
-static void dfsMarkWithoutHashCons (GC_state s, objptr *opp);
-static void dfsUnmark (GC_state s, objptr *opp);
+static inline void dfsMarkWithHashCons (GC_state s, objptr *opp);
+static inline void dfsMarkWithoutHashCons (GC_state s, objptr *opp);
+static inline void dfsUnmark (GC_state s, objptr *opp);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/enter_leave.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/enter_leave.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/enter_leave.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -8,7 +8,7 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static void enter (GC_state s);
-static void leave (GC_state s);
+static inline void enter (GC_state s);
+static inline void leave (GC_state s);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -10,12 +10,12 @@
typedef void (*GC_foreachObjptrFun) (GC_state s, objptr *opp);
-static void callIfIsObjptr (GC_state s, GC_foreachObjptrFun f, objptr *opp);
+static inline void callIfIsObjptr (GC_state s, GC_foreachObjptrFun f, objptr *opp);
/* foreachGlobalObjptr (s, f)
*
* Apply f to each global object pointer into the heap.
*/
-static void foreachGlobalObjptr (GC_state s, GC_foreachObjptrFun f);
+static inline void foreachGlobalObjptr (GC_state s, GC_foreachObjptrFun f);
/* foreachObjptrInObject (s, p, skipWeaks, f)
*
* Applies f to each object pointer in the object pointed to by p.
@@ -23,8 +23,8 @@
*
* If skipWeaks, then the object pointer in weak objects is skipped.
*/
-static pointer foreachObjptrInObject (GC_state s, pointer p,
- GC_foreachObjptrFun f, bool skipWeaks);
+static inline pointer foreachObjptrInObject (GC_state s, pointer p,
+ GC_foreachObjptrFun f, bool skipWeaks);
/* foreachObjptrInRange (s, front, back, f, skipWeaks)
*
* Apply f to each pointer between front and *back, which should be a
@@ -36,8 +36,8 @@
*
* If skipWeaks, then the object pointer in weak objects is skipped.
*/
-static pointer foreachObjptrInRange (GC_state s, pointer front, pointer *back,
- GC_foreachObjptrFun f, bool skipWeaks);
+static inline pointer foreachObjptrInRange (GC_state s, pointer front, pointer *back,
+ GC_foreachObjptrFun f, bool skipWeaks);
typedef void (*GC_foreachStackFrameFun) (GC_state s, GC_frameIndex i);
@@ -46,6 +46,6 @@
*
* Apply f to the frame index of each frame in the current stack.
*/
-static void foreachStackFrame (GC_state s, GC_foreachStackFrameFun f);
+static inline void foreachStackFrame (GC_state s, GC_foreachStackFrameFun f);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/forward.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/forward.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/forward.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -21,10 +21,10 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static bool isPointerInToSpace (GC_state s, pointer p);
-static bool isObjptrInToSpace (GC_state s, objptr op);
-static void forwardObjptr (GC_state s, objptr *opp);
-static void forwardObjptrIfInNursery (GC_state s, objptr *opp);
-static void forwardInterGenerationalObjptrs (GC_state s);
+static inline bool isPointerInToSpace (GC_state s, pointer p);
+static inline bool isObjptrInToSpace (GC_state s, objptr op);
+static inline void forwardObjptr (GC_state s, objptr *opp);
+static inline void forwardObjptrIfInNursery (GC_state s, objptr *opp);
+static inline void forwardInterGenerationalObjptrs (GC_state s);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -51,8 +51,8 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static GC_frameIndex getFrameIndexFromReturnAddress (GC_state s, GC_returnAddress ra);
-static GC_frameLayout getFrameLayoutFromFrameIndex (GC_state s, GC_frameIndex index);
-static GC_frameLayout getFrameLayoutFromReturnAddress (GC_state s, GC_returnAddress ra);
+static inline GC_frameIndex getFrameIndexFromReturnAddress (GC_state s, GC_returnAddress ra);
+static inline GC_frameLayout getFrameLayoutFromFrameIndex (GC_state s, GC_frameIndex index);
+static inline GC_frameLayout getFrameLayoutFromReturnAddress (GC_state s, GC_returnAddress ra);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/garbage-collection.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/garbage-collection.c 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/garbage-collection.c 2005-11-16 04:07:42 UTC (rev 4239)
@@ -14,7 +14,7 @@
uintmax_t numGCs;
size_t desiredSize;
- s->cumulativeStatistics.numMinorGCs = 0;
+ s->lastMajorStatistics.numMinorGCs = 0;
numGCs =
s->cumulativeStatistics.numCopyingGCs
+ s->cumulativeStatistics.numMarkCompactGCs;
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-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/garbage-collection.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -10,18 +10,18 @@
static void minorGC (GC_state s);
static void majorGC (GC_state s, size_t bytesRequested, bool mayResize);
-static void growStackCurrent (GC_state s);
-static void enterGC (GC_state s);
-static void leaveGC (GC_state s);
+static inline void growStackCurrent (GC_state s);
+static inline void enterGC (GC_state s);
+static inline void leaveGC (GC_state s);
static void performGC (GC_state s,
size_t oldGenBytesRequested,
size_t nurseryBytesRequested,
bool forceMajor,
bool mayResize);
-static void ensureInvariantForMutator (GC_state s, bool force);
-static void ensureHasHeapBytesFree (GC_state s,
- size_t oldGenBytesRequested,
- size_t nurseryBytesRequested);
+static inline void ensureInvariantForMutator (GC_state s, bool force);
+static inline void ensureHasHeapBytesFree (GC_state s,
+ size_t oldGenBytesRequested,
+ size_t nurseryBytesRequested);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
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-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -69,8 +69,8 @@
static void displayGCState (GC_state s, FILE *stream);
-static size_t sizeofGCStateCurrentStackUsed (GC_state s);
-static void setGCStateCurrentThreadAndStack (GC_state s);
+static inline size_t sizeofGCStateCurrentStackUsed (GC_state s);
+static inline void setGCStateCurrentThreadAndStack (GC_state s);
static void setGCStateCurrentHeap (GC_state s,
size_t oldGenBytesRequested,
size_t nurseryBytesRequested);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -56,19 +56,19 @@
struct GC_generationalMaps *generational,
FILE *stream);
-static GC_cardMapIndex pointerToCardMapIndexAbsolute (pointer p);
-static GC_cardMapIndex sizeToCardMapIndex (size_t z);
-static size_t cardMapIndexToSize (GC_cardMapIndex i);
-static pointer pointerToCardMapAddr (GC_state s, pointer p);
+static inline GC_cardMapIndex pointerToCardMapIndexAbsolute (pointer p);
+static inline GC_cardMapIndex sizeToCardMapIndex (size_t z);
+static inline size_t cardMapIndexToSize (GC_cardMapIndex i);
+static inline pointer pointerToCardMapAddr (GC_state s, pointer p);
-static bool isCardMarked (GC_state s, pointer p);
-static void markCard (GC_state s, pointer p);
+static inline bool isCardMarked (GC_state s, pointer p);
+static inline void markCard (GC_state s, pointer p);
-static void setCardMapAbsolute (GC_state s);
-static pointer getCrossMapCardStart (GC_state s, pointer p);
+static inline void setCardMapAbsolute (GC_state s);
+static inline pointer getCrossMapCardStart (GC_state s, pointer p);
-static void clearCardMap (GC_state s);
-static void clearCrossMap (GC_state s);
+static inline void clearCardMap (GC_state s);
+static inline void clearCrossMap (GC_state s);
static void createCardMapAndCrossMap (GC_state s);
static void resizeCardMapAndCrossMap (GC_state s);
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-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/handler.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -8,7 +8,7 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static void switchToSignalHandlerThreadIfNonAtomicAndSignalPending (GC_state s);
+static inline void switchToSignalHandlerThreadIfNonAtomicAndSignalPending (GC_state s);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/hash-cons.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/hash-cons.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/hash-cons.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -35,16 +35,16 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static GC_objectHashTable allocHashTable (GC_state s);
-static void freeHashTable (GC_objectHashTable t);
+static inline GC_objectHashTable allocHashTable (GC_state s);
+static inline void freeHashTable (GC_objectHashTable t);
-static pointer insertHashTableElem (GC_state s,
- GC_objectHashTable t, GC_hash hash,
- pointer object, pointer max, bool mightBeThere);
-static void growHashTableMaybe (GC_state s, GC_objectHashTable t);
+static inline pointer insertHashTableElem (GC_state s,
+ GC_objectHashTable t, GC_hash hash,
+ pointer object, pointer max, bool mightBeThere);
+static inline void growHashTableMaybe (GC_state s, GC_objectHashTable t);
static pointer hashConsPointer (GC_state s, pointer object, bool countBytesHashConsed);
-static void shareObjptr (GC_state s, objptr *opp);
+static inline void shareObjptr (GC_state s, objptr *opp);
static void printBytesHashConsedMessage (GC_state s, uintmax_t total);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -34,22 +34,23 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static bool isPointerInHeap (GC_state s, pointer p);
-static bool isPointerInOldGen (GC_state s, pointer p);
-static bool isPointerInNursery (GC_state s, pointer p);
-static bool isPointerInFromSpace (GC_state s, pointer p);
-static bool isObjptrInHeap (GC_state s, objptr op);
-static bool isObjptrInOldGen (GC_state s, objptr op);
-static bool isObjptrInNursery (GC_state s, objptr op);
-static bool isObjptrInFromSpace (GC_state s, objptr op);
-static bool hasHeapBytesFree (GC_state s, size_t oldGen, size_t nursery);
-static bool isHeapInit (GC_heap h);
+static inline bool isPointerInHeap (GC_state s, pointer p);
+static inline bool isPointerInOldGen (GC_state s, pointer p);
+static inline bool isPointerInNursery (GC_state s, pointer p);
+static inline bool isPointerInFromSpace (GC_state s, pointer p);
+static inline bool isObjptrInHeap (GC_state s, objptr op);
+static inline bool isObjptrInOldGen (GC_state s, objptr op);
+static inline bool isObjptrInNursery (GC_state s, objptr op);
+static inline bool isObjptrInFromSpace (GC_state s, objptr op);
+static inline bool hasHeapBytesFree (GC_state s, size_t oldGen, size_t nursery);
+static inline bool isHeapInit (GC_heap h);
static void displayHeap (GC_state s, GC_heap heap, FILE *stream);
-static void initHeap (GC_state s, GC_heap h);
-static size_t sizeofHeapDesired (GC_state s, size_t live, size_t currentSize);
-static void releaseHeap (GC_state s, GC_heap h);
+static inline void initHeap (GC_state s, GC_heap h);
+static inline size_t sizeofHeapDesired (GC_state s, size_t live, size_t currentSize);
+
+static inline void releaseHeap (GC_state s, GC_heap h);
static void shrinkHeap (GC_state s, GC_heap h, size_t keep);
static bool createHeap (GC_state s, GC_heap h, size_t desiredSize, size_t minSize);
static bool createHeapSecondary (GC_state s, size_t desiredSize);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/invariant.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/invariant.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/invariant.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -8,10 +8,10 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static void assertIsObjptrInFromSpace (GC_state s, objptr *opp);
+static inline void assertIsObjptrInFromSpace (GC_state s, objptr *opp);
static bool invariantForGC (GC_state s);
-static bool invariantForMutatorFrontier (GC_state s);
-static bool invariantForMutatorStack (GC_state s);
+static inline bool invariantForMutatorFrontier (GC_state s);
+static inline bool invariantForMutatorStack (GC_state s);
static bool invariantForMutator (GC_state s, bool frontier, bool stack);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -8,9 +8,9 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static void copyForThreadInternal (pointer dst, pointer src);
-static void threadInternalObjptr (GC_state s, objptr *opp);
-static void clearIfWeakAndUnmarkedForMarkCompact (GC_state s, pointer p);
+static inline void copyForThreadInternal (pointer dst, pointer src);
+static inline void threadInternalObjptr (GC_state s, objptr *opp);
+static inline void clearIfWeakAndUnmarkedForMarkCompact (GC_state s, pointer p);
static void updateForwardPointersForMarkCompact (GC_state s);
static void updateBackwardPointersAndSlideForMarkCompact (GC_state s);
static void majorMarkCompactGC (GC_state s);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/new-object.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/new-object.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/new-object.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -8,9 +8,9 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static pointer newObject (GC_state s, GC_header header,
- size_t bytesRequested, bool allocInOldGen);
-static GC_stack newStack (GC_state s, size_t reserved, bool allocInOldGen);
+static inline pointer newObject (GC_state s, GC_header header,
+ size_t bytesRequested, bool allocInOldGen);
+static inline GC_stack newStack (GC_state s, size_t reserved, bool allocInOldGen);
static GC_thread newThread (GC_state s, size_t stackSize);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/object-size.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/object-size.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/object-size.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -8,10 +8,10 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static size_t sizeofArrayNoHeader (GC_state s, GC_arrayLength numElements,
- uint16_t numNonObjptrs, uint16_t numObjptrs);
-static size_t sizeofStackNoHeader (GC_state s, GC_stack stack);
+static inline size_t sizeofArrayNoHeader (GC_state s, GC_arrayLength numElements,
+ uint16_t numNonObjptrs, uint16_t numObjptrs);
+static inline size_t sizeofStackNoHeader (GC_state s, GC_stack stack);
-static size_t sizeofObject (GC_state s, pointer p);
+static inline size_t sizeofObject (GC_state s, pointer p);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -59,9 +59,9 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static GC_header* getHeaderp (pointer p);
-static GC_header getHeader (pointer p);
-static GC_header buildHeaderFromTypeIndex (uint32_t t);
+static inline GC_header* getHeaderp (pointer p);
+static inline GC_header getHeader (pointer p);
+static inline GC_header buildHeaderFromTypeIndex (uint32_t t);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
@@ -145,9 +145,9 @@
#define GC_WORD16_VECTOR_HEADER buildHeaderFromTypeIndex (WORD16_VECTOR_TYPE_INDEX)
#define GC_WORD32_VECTOR_HEADER buildHeaderFromTypeIndex (WORD32_VECTOR_TYPE_INDEX)
-static void splitHeader (GC_state s, GC_header header,
- GC_objectTypeTag *tagRet, bool *hasIdentityRet,
- uint16_t *bytesNonObjptrsRet, uint16_t *numObjptrsRet);
-static pointer advanceToObjectData (GC_state s, pointer p);
+static inline void splitHeader (GC_state s, GC_header header,
+ GC_objectTypeTag *tagRet, bool *hasIdentityRet,
+ uint16_t *bytesNonObjptrsRet, uint16_t *numObjptrsRet);
+static inline pointer advanceToObjectData (GC_state s, pointer p);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/objptr.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/objptr.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/objptr.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -27,10 +27,10 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static bool isObjptr (objptr p);
-static pointer objptrToPointer (objptr O, pointer B);
-static objptr pointerToObjptr (pointer P, pointer B);
-static pointer fetchObjptrToPointer (pointer OP, pointer B);
-static void storeObjptrFromPointer (pointer OP, pointer P, pointer B);
+static inline bool isObjptr (objptr p);
+static inline pointer objptrToPointer (objptr O, pointer B);
+static inline objptr pointerToObjptr (pointer P, pointer B);
+static inline pointer fetchObjptrToPointer (pointer OP, pointer B);
+static inline void storeObjptrFromPointer (pointer OP, pointer P, pointer B);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -10,6 +10,6 @@
#define BOGUS_POINTER (pointer)0x1
-static bool isPointer (pointer p);
+static inline bool isPointer (pointer p);
#endif /* (defined (MLTON_GC_INTERNAL_TYPES)) */
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-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/profiling.c 2005-11-16 04:07:42 UTC (rev 4239)
@@ -42,7 +42,7 @@
ps = getProfileStackInfo (s, i);
if (DEBUG_PROFILE)
fprintf (stderr, "adding %s to stack lastTotal = %"PRIuMAX" lastTotalGC = %"PRIuMAX"\n",
- GC_sourceName (s, i),
+ getSourceName (s, i),
p->total,
p->totalGC);
ps->lastTotal = p->total;
@@ -79,7 +79,7 @@
if (DEBUG_ENTER_LEAVE or DEBUG_PROFILE) {
profileIndent ();
fprintf (stderr, "(entering %s\n",
- GC_sourceName (s, sourceIndex));
+ getSourceName (s, sourceIndex));
profileDepth++;
}
enterSourceForProfiling (s, (GC_profileMasterIndex)sourceIndex);
@@ -103,7 +103,7 @@
ps = getProfileStackInfo (s, i);
if (DEBUG_PROFILE)
fprintf (stderr, "removing %s from stack ticksInc = %"PRIuMAX" ticksGCInc = %"PRIuMAX"\n",
- GC_sourceName (s, i),
+ getSourceName (s, i),
p->total - ps->lastTotal,
p->totalGC - ps->lastTotalGC);
ps->ticks += p->total - ps->lastTotal;
@@ -140,7 +140,7 @@
profileDepth--;
profileIndent ();
fprintf (stderr, "leaving %s)\n",
- GC_sourceName (s, sourceIndex));
+ getSourceName (s, sourceIndex));
}
leaveSourceForProfiling (s, (GC_profileMasterIndex)sourceIndex);
leaveSourceForProfiling (s, sourceIndexToProfileMasterIndex (s, sourceIndex));
@@ -156,12 +156,12 @@
}
-void profileInc (GC_state s, size_t amount, GC_sourceSeqIndex sourceSeqIndex) {
+void incForProfiling (GC_state s, size_t amount, GC_sourceSeqIndex sourceSeqIndex) {
uint32_t *sourceSeq;
GC_sourceIndex topSourceIndex;
if (DEBUG_PROFILE)
- fprintf (stderr, "profileInc (%zu, "FMTSSI")\n",
+ fprintf (stderr, "incForProfiling (%zu, "FMTSSI")\n",
amount, sourceSeqIndex);
assert (sourceSeqIndex < s->sourceMaps.sourceSeqsLength);
sourceSeq = s->sourceMaps.sourceSeqs[sourceSeqIndex];
@@ -172,7 +172,7 @@
if (DEBUG_PROFILE) {
profileIndent ();
fprintf (stderr, "bumping %s by %zu\n",
- GC_sourceName (s, topSourceIndex), amount);
+ getSourceName (s, topSourceIndex), amount);
}
s->profiling.data->countTop[topSourceIndex] += amount;
s->profiling.data->countTop[sourceIndexToProfileMasterIndex (s, topSourceIndex)] += amount;
@@ -189,10 +189,10 @@
void GC_profileInc (GC_state s, size_t amount) {
if (DEBUG_PROFILE)
fprintf (stderr, "GC_profileInc (%zu)\n", amount);
- profileInc (s, amount,
- s->amInGC
- ? SOURCE_SEQ_GC
- : getStackTopFrameSourceSeqIndex (s, getStackCurrent (s)));
+ incForProfiling (s, amount,
+ s->amInGC
+ ? SOURCE_SEQ_GC
+ : getStackTopFrameSourceSeqIndex (s, getStackCurrent (s)));
}
void GC_profileAllocInc (GC_state s, size_t amount) {
@@ -229,8 +229,8 @@
free (p);
}
-static void writeProfileCount (GC_state s, int fd,
- GC_profileData p, GC_profileMasterIndex i) {
+void writeProfileCount (GC_state s, int fd,
+ GC_profileData p, GC_profileMasterIndex i) {
writeUintmaxU (fd, p->countTop[i]);
if (s->profiling.stack) {
GC_profileStack ps;
@@ -303,7 +303,7 @@
* mlton/main/main.fun to make sure that time profiling is never
* turned on.
*/
-void initProfilingTime (GC_state s) __attribute__ ((noreturn));
+static void initProfilingTime (GC_state s) __attribute__ ((noreturn));
void initProfilingTime (__attribute__ ((unused)) GC_state s) {
die ("no time profiling");
}
@@ -336,9 +336,10 @@
}
}
}
- profileInc (s, 1, sourceSeqIndex);
+ incForProfiling (s, 1, sourceSeqIndex);
}
+static void initProfilingTime (GC_state s);
static void initProfilingTime (GC_state s) {
struct sigaction sa;
@@ -375,7 +376,7 @@
*/
static GC_state atexitForProfilingState;
-static void atexitForProfiling (void) {
+void atexitForProfiling (void) {
int fd;
GC_state s;
@@ -433,7 +434,7 @@
if (DEBUG_PROFILE)
fprintf (stderr, "done leaving %s\n",
(profileMasterIndex < s->sourceMaps.sourcesLength)
- ? GC_sourceName (s, (GC_sourceIndex)profileMasterIndex)
+ ? getSourceName (s, (GC_sourceIndex)profileMasterIndex)
: s->sourceMaps.sourceNames[
profileMasterIndexToSourceNameIndex (s, profileMasterIndex)]);
removeFromStackForProfiling (s, profileMasterIndex);
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-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/profiling.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -79,24 +79,27 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static GC_profileMasterIndex sourceIndexToProfileMasterIndex (GC_state s, GC_sourceIndex i);
-static GC_sourceNameIndex profileMasterIndexToSourceNameIndex (GC_state s, GC_profileMasterIndex i);
-static GC_profileStack getProfileStackInfo (GC_state s, GC_profileMasterIndex i);
+static inline GC_profileMasterIndex sourceIndexToProfileMasterIndex (GC_state s, GC_sourceIndex i);
+static inline GC_sourceNameIndex profileMasterIndexToSourceNameIndex (GC_state s, GC_profileMasterIndex i);
+static inline GC_profileStack getProfileStackInfo (GC_state s, GC_profileMasterIndex i);
-static void addToStackForProfiling (GC_state s, GC_profileMasterIndex i);
-static void enterSourceForProfiling (GC_state s, GC_profileMasterIndex i);
-static void enterForProfiling (GC_state s, GC_sourceSeqIndex sourceSeqIndex);
-static void enterFrameForProfiling (GC_state s, GC_frameIndex i);
+static inline void addToStackForProfiling (GC_state s, GC_profileMasterIndex i);
+static inline void enterSourceForProfiling (GC_state s, GC_profileMasterIndex i);
+static inline void enterForProfiling (GC_state s, GC_sourceSeqIndex sourceSeqIndex);
+static inline void enterFrameForProfiling (GC_state s, GC_frameIndex i);
-static void removeFromStackForProfiling (GC_state s, GC_profileMasterIndex i);
-static void leaveSourceForProfiling (GC_state s, GC_profileMasterIndex i);
-static void leaveForProfiling (GC_state s, GC_sourceSeqIndex sourceSeqIndex);
-static void leaveFrameForProfiling (GC_state s, GC_frameIndex i);
+static inline void removeFromStackForProfiling (GC_state s, GC_profileMasterIndex i);
+static inline void leaveSourceForProfiling (GC_state s, GC_profileMasterIndex i);
+static inline void leaveForProfiling (GC_state s, GC_sourceSeqIndex sourceSeqIndex);
+static inline void leaveFrameForProfiling (GC_state s, GC_frameIndex i);
-static void profileInc (GC_state s, size_t amount, GC_sourceSeqIndex sourceSeqIndex);
+static inline void incForProfiling (GC_state s, size_t amount, GC_sourceSeqIndex sourceSeqIndex);
+static void writeProfileCount (GC_state s, int fd, GC_profileData p, GC_profileMasterIndex i);
+
static void setProfTimer (long usec);
static void initProfiling (GC_state s);
+static void atexitForProfiling (void);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/rusage.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/rusage.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/rusage.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -6,14 +6,14 @@
* See the file MLton-LICENSE for details.
*/
-static void rusageZero (struct rusage *ru);
-static void rusagePlusMax (struct rusage *ru1,
- struct rusage *ru2,
- struct rusage *ru);
-static void rusageMinusMax (struct rusage *ru1,
- struct rusage *ru2,
- struct rusage *ru);
-static uintmax_t rusageTime (struct rusage *ru);
-static uintmax_t getCurrentTime (void);
-static void startTiming (struct rusage *ru_start);
+static inline void rusageZero (struct rusage *ru);
+static inline void rusagePlusMax (struct rusage *ru1,
+ struct rusage *ru2,
+ struct rusage *ru);
+static inline void rusageMinusMax (struct rusage *ru1,
+ struct rusage *ru2,
+ struct rusage *ru);
+static inline uintmax_t rusageTime (struct rusage *ru);
+static inline uintmax_t getCurrentTime (void);
+static inline void startTiming (struct rusage *ru_start);
static uintmax_t stopTiming (struct rusage *ru_start, struct rusage *ru_gc);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.c 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.c 2005-11-16 04:07:42 UTC (rev 4239)
@@ -10,11 +10,15 @@
return s->sourceMaps.frameSources[getStackTopFrameIndex (s, stack)];
}
-char* GC_sourceName (GC_state s, GC_sourceIndex i) {
+char* getSourceName (GC_state s, GC_sourceIndex i) {
assert (i < s->sourceMaps.sourcesLength);
return s->sourceMaps.sourceNames[s->sourceMaps.sources[i].sourceNameIndex];
}
+char* GC_sourceName (GC_state s, GC_sourceIndex i) {
+ return getSourceName (s, i);
+}
+
int compareSourceLabels (const void *v1, const void *v2) {
const struct GC_sourceLabel* l1 = (const struct GC_sourceLabel*)v1;
const struct GC_sourceLabel* l2 = (const struct GC_sourceLabel*)v2;
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-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -74,9 +74,11 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static GC_sourceSeqIndex getStackTopFrameSourceSeqIndex (GC_state s, GC_stack stack);
+static inline GC_sourceSeqIndex getStackTopFrameSourceSeqIndex (GC_state s, GC_stack stack);
-static int compareSourceLabels (const void *v1, const void *v2);
+static inline char* getSourceName (GC_state s, GC_sourceIndex i);
+
+static inline int compareSourceLabels (const void *v1, const void *v2);
static void sortSourceLabels (GC_state s);
static void initTextSources (GC_state s);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -57,25 +57,25 @@
static void displayStack (GC_state s, GC_stack stack, FILE *stream);
-static bool isStackEmpty (GC_stack stack);
-static bool isStackReservedAligned (GC_state s, size_t reserved);
+static inline bool isStackEmpty (GC_stack stack);
+static inline bool isStackReservedAligned (GC_state s, size_t reserved);
-static size_t sizeofStackSlop (GC_state s);
-static size_t sizeofStackInitial (GC_state s);
+static inline size_t sizeofStackSlop (GC_state s);
+static inline size_t sizeofStackInitial (GC_state s);
-static pointer getStackBottom (GC_state s, GC_stack stack);
-static pointer getStackTop (GC_state s, GC_stack stack);
-static pointer getStackLimitPlusSlop (GC_state s, GC_stack stack);
-static pointer getStackLimit (GC_state s, GC_stack stack);
-static GC_frameIndex getStackTopFrameIndex (GC_state s, GC_stack stack);
-static GC_frameLayout getStackTopFrameLayout (GC_state s, GC_stack stack);
-static uint16_t getStackTopFrameSize (GC_state s, GC_stack stack);
+static inline pointer getStackBottom (GC_state s, GC_stack stack);
+static inline pointer getStackTop (GC_state s, GC_stack stack);
+static inline pointer getStackLimitPlusSlop (GC_state s, GC_stack stack);
+static inline pointer getStackLimit (GC_state s, GC_stack stack);
+static inline GC_frameIndex getStackTopFrameIndex (GC_state s, GC_stack stack);
+static inline GC_frameLayout getStackTopFrameLayout (GC_state s, GC_stack stack);
+static inline uint16_t getStackTopFrameSize (GC_state s, GC_stack stack);
-static size_t sizeofStackMinimumReserved (GC_state s, GC_stack stack);
-static size_t alignStackReserved (GC_state s, size_t reserved);
-static size_t sizeofStackWithHeaderAligned (GC_state s, size_t reserved);
-static size_t sizeofStackGrow (GC_state s, GC_stack stack);
+static inline size_t sizeofStackMinimumReserved (GC_state s, GC_stack stack);
+static inline size_t alignStackReserved (GC_state s, size_t reserved);
+static inline size_t sizeofStackWithHeaderAligned (GC_state s, size_t reserved);
+static inline size_t sizeofStackGrow (GC_state s, GC_stack stack);
-static void copyStack (GC_state s, GC_stack from, GC_stack to);
+static inline void copyStack (GC_state s, GC_stack from, GC_stack to);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
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-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/switch-thread.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -8,7 +8,7 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static void switchToThread (GC_state s, objptr op);
+static inline void switchToThread (GC_state s, objptr op);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/thread.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/thread.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/thread.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -34,6 +34,6 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
static void displayThread (GC_state s, GC_thread thread, FILE *stream);
-static size_t sizeofThread (GC_state s);
+static inline size_t sizeofThread (GC_state s);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/translate.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/translate.h 2005-11-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/translate.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -8,7 +8,7 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static void translateObjptr (GC_state s, objptr *opp);
+static inline void translateObjptr (GC_state s, objptr *opp);
static void translateHeap (GC_state s, pointer from, pointer to, size_t size);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */
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-16 03:48:50 UTC (rev 4238)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.h 2005-11-16 04:07:42 UTC (rev 4239)
@@ -37,8 +37,8 @@
#if (defined (MLTON_GC_INTERNAL_FUNCS))
-static size_t sizeofWeak (GC_state s);
-static size_t offsetofWeak (GC_state s);
+static inline size_t sizeofWeak (GC_state s);
+static inline size_t offsetofWeak (GC_state s);
#endif /* (defined (MLTON_GC_INTERNAL_FUNCS)) */