|
From: Vitor S. C. <vs...@us...> - 2001-06-11 15:09:42
|
Update of /cvsroot/yap/C
In directory usw-pr-cvs1:/tmp/cvs-serv31281/C
Modified Files:
heapgc.c
Log Message:
fix big ints in gc
recount trail pointers that were reset in the previous step
Index: heapgc.c
===================================================================
RCS file: /cvsroot/yap/C/heapgc.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- heapgc.c 2001/06/08 19:33:16 1.16
+++ heapgc.c 2001/06/11 15:09:36 1.17
@@ -22,7 +22,9 @@
#include "yapio.h"
#define EARLY_RESET 1
+#ifndef TABLING
#define EASY_SHUNTING 1
+#endif
#define HYBRID_SCHEME 1
@@ -663,7 +665,7 @@
#ifdef DEBUG
#define INSTRUMENT_GC 1
-/* #define CHECK_CHOICEPOINTS 1 */
+#define CHECK_CHOICEPOINTS 1
#ifdef INSTRUMENT_GC
typedef enum {
@@ -969,9 +971,9 @@
(sizeof(MP_INT)+
(((MP_INT *)(next+1))->_mp_alloc*sizeof(mp_limb_t)))/CellSize;
{
- int i = 1;
+ int i;
PUSH_POINTER(next);
- for (i = 0; i <= (sizeof(MP_INT)+
+ for (i = 1; i <= (sizeof(MP_INT)+
(((MP_INT *)(next+1))->_mp_alloc*sizeof(mp_limb_t)))/CellSize;
i++)
PUSH_POINTER(next+i);
@@ -1198,6 +1200,10 @@
trail_cell = TrailTerm(trail_ptr);
+ if (trail_cell == 0xa0000006) {
+ printf("Oops at %p->%x\n", trail_ptr, trail_cell);
+ }
+
if (IsVarTerm(trail_cell)) {
CELL *hp = (CELL *)trail_cell;
/* if a variable older than the current CP has not been marked yet,
@@ -1230,6 +1236,8 @@
#endif
discard_trail_entries++;
} else {
+ if (trail_cell == (CELL)trail_ptr)
+ discard_trail_entries++;
#ifdef EASY_SHUNTING
if (hp < gc_H && hp >= H0) {
CELL *cptr = (CELL *)trail_cell;
@@ -1773,6 +1781,8 @@
(ADDR) pt0 >= TrailBase
#endif
) {
+ trail_ptr++;
+ dest++;
continue;
}
#endif /* FROZEN_REGS */
|