fix big ints in gc
recount trail pointers that were reset in the previous step git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@74 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
e8b19c99c1
commit
6e2ccc4cf4
16
C/heapgc.c
16
C/heapgc.c
@ -22,7 +22,9 @@ static char SccsId[] = "%W% %G%";
|
|||||||
#include "yapio.h"
|
#include "yapio.h"
|
||||||
|
|
||||||
#define EARLY_RESET 1
|
#define EARLY_RESET 1
|
||||||
|
#ifndef TABLING
|
||||||
#define EASY_SHUNTING 1
|
#define EASY_SHUNTING 1
|
||||||
|
#endif
|
||||||
#define HYBRID_SCHEME 1
|
#define HYBRID_SCHEME 1
|
||||||
|
|
||||||
|
|
||||||
@ -663,7 +665,7 @@ init_dbtable(tr_fr_ptr trail_ptr) {
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
||||||
#define INSTRUMENT_GC 1
|
#define INSTRUMENT_GC 1
|
||||||
/* #define CHECK_CHOICEPOINTS 1 */
|
#define CHECK_CHOICEPOINTS 1
|
||||||
|
|
||||||
#ifdef INSTRUMENT_GC
|
#ifdef INSTRUMENT_GC
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -969,9 +971,9 @@ mark_variable(CELL_PTR current)
|
|||||||
(sizeof(MP_INT)+
|
(sizeof(MP_INT)+
|
||||||
(((MP_INT *)(next+1))->_mp_alloc*sizeof(mp_limb_t)))/CellSize;
|
(((MP_INT *)(next+1))->_mp_alloc*sizeof(mp_limb_t)))/CellSize;
|
||||||
{
|
{
|
||||||
int i = 1;
|
int i;
|
||||||
PUSH_POINTER(next);
|
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;
|
(((MP_INT *)(next+1))->_mp_alloc*sizeof(mp_limb_t)))/CellSize;
|
||||||
i++)
|
i++)
|
||||||
PUSH_POINTER(next+i);
|
PUSH_POINTER(next+i);
|
||||||
@ -1198,6 +1200,10 @@ mark_trail(tr_fr_ptr trail_ptr, tr_fr_ptr trail_base, CELL *gc_H, choiceptr gc_B
|
|||||||
|
|
||||||
trail_cell = TrailTerm(trail_ptr);
|
trail_cell = TrailTerm(trail_ptr);
|
||||||
|
|
||||||
|
if (trail_cell == 0xa0000006) {
|
||||||
|
printf("Oops at %p->%x\n", trail_ptr, trail_cell);
|
||||||
|
}
|
||||||
|
|
||||||
if (IsVarTerm(trail_cell)) {
|
if (IsVarTerm(trail_cell)) {
|
||||||
CELL *hp = (CELL *)trail_cell;
|
CELL *hp = (CELL *)trail_cell;
|
||||||
/* if a variable older than the current CP has not been marked yet,
|
/* if a variable older than the current CP has not been marked yet,
|
||||||
@ -1230,6 +1236,8 @@ mark_trail(tr_fr_ptr trail_ptr, tr_fr_ptr trail_base, CELL *gc_H, choiceptr gc_B
|
|||||||
#endif
|
#endif
|
||||||
discard_trail_entries++;
|
discard_trail_entries++;
|
||||||
} else {
|
} else {
|
||||||
|
if (trail_cell == (CELL)trail_ptr)
|
||||||
|
discard_trail_entries++;
|
||||||
#ifdef EASY_SHUNTING
|
#ifdef EASY_SHUNTING
|
||||||
if (hp < gc_H && hp >= H0) {
|
if (hp < gc_H && hp >= H0) {
|
||||||
CELL *cptr = (CELL *)trail_cell;
|
CELL *cptr = (CELL *)trail_cell;
|
||||||
@ -1773,6 +1781,8 @@ sweep_trail(choiceptr gc_B, tr_fr_ptr old_TR)
|
|||||||
(ADDR) pt0 >= TrailBase
|
(ADDR) pt0 >= TrailBase
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
|
trail_ptr++;
|
||||||
|
dest++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif /* FROZEN_REGS */
|
#endif /* FROZEN_REGS */
|
||||||
|
Reference in New Issue
Block a user