CVS: sml/src/runtime/c-libs/smlnj-runtime gc-ctl.c,1.3,1.4
John Reppy <[email protected]>
| Newsgroups | gmane.comp.lang.sml.smlnj.commits |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/smlnj/sml/src/runtime/c-libs/smlnj-runtime
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31352
Modified Files:
gc-ctl.c
Log Message:
Bug fix: Pointers to heap objects were not being preserved across GC.
Index: gc-ctl.c
===================================================================
RCS file: /cvsroot/smlnj/sml/src/runtime/c-libs/smlnj-runtime/gc-ctl.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** gc-ctl.c 1 Jun 2000 18:33:47 -0000 1.3
--- gc-ctl.c 30 Apr 2005 13:35:23 -0000 1.4
***************
*** 16,22 ****
#define STREQ(s1, s2) (strcmp((s1), STR_MLtoC(s2)) == 0)
! PVT void SetVMCache (ml_state_t *msp, ml_val_t arg);
! PVT void DoGC (ml_state_t *msp, ml_val_t arg);
! PVT void AllGC (ml_state_t *msp);
--- 16,22 ----
#define STREQ(s1, s2) (strcmp((s1), STR_MLtoC(s2)) == 0)
! PVT void SetVMCache (ml_state_t *msp, ml_val_t cell);
! PVT void DoGC (ml_state_t *msp, ml_val_t cell, ml_val_t *next);
! PVT void AllGC (ml_state_t *msp, ml_val_t *next);
***************
*** 40,49 ****
ml_val_t cell = REC_SEL(cmd, 1);
if (STREQ("SetVMCache", oper))
SetVMCache (msp, cell);
else if (STREQ("DoGC", oper))
! DoGC (msp, cell);
else if (STREQ("AllGC", oper))
! AllGC (msp);
else if (STREQ("Messages", oper)) {
if (INT_MLtoC(DEREF(cell)) > 0)
--- 40,51 ----
ml_val_t cell = REC_SEL(cmd, 1);
+ arg = LIST_tl(arg);
+
if (STREQ("SetVMCache", oper))
SetVMCache (msp, cell);
else if (STREQ("DoGC", oper))
! DoGC (msp, cell, &arg);
else if (STREQ("AllGC", oper))
! AllGC (msp, &arg);
else if (STREQ("Messages", oper)) {
if (INT_MLtoC(DEREF(cell)) > 0)
***************
*** 52,57 ****
GCMessages = FALSE;
}
-
- arg = LIST_tl(arg);
}
--- 54,57 ----
***************
*** 92,96 ****
* Force a garbage collection of the given level.
*/
! PVT void DoGC (ml_state_t *msp, ml_val_t arg)
{
heap_t *heap = msp->ml_heap;
--- 92,96 ----
* Force a garbage collection of the given level.
*/
! PVT void DoGC (ml_state_t *msp, ml_val_t arg, ml_val_t *next)
{
heap_t *heap = msp->ml_heap;
***************
*** 102,106 ****
level = heap->numGens;
! InvokeGC (msp, level);
} /* end of DoGC */
--- 102,106 ----
level = heap->numGens;
! InvokeGCWithRoots (msp, level, next, NIL(ml_val_t *));
} /* end of DoGC */
***************
*** 111,117 ****
* Force a garbage collection of all generations.
*/
! PVT void AllGC (ml_state_t *msp)
{
! InvokeGC (msp, msp->ml_heap->numGens);
} /* end of AllGC */
--- 111,117 ----
* Force a garbage collection of all generations.
*/
! PVT void AllGC (ml_state_t *msp, ml_val_t *next)
{
! InvokeGCWithRoots (msp, msp->ml_heap->numGens, next, NIL(ml_val_t *));
} /* end of AllGC */
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20