garbage collection of ma vars was fixed in 64 bit machines, due to int/Int problems.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1293 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
1e93141fae
commit
e1b2820d21
18
C/heapgc.c
18
C/heapgc.c
@ -344,9 +344,10 @@ GC_NEW_MAHASH(gc_ma_hash_entry *top) {
|
|||||||
UInt time = ++timestamp;
|
UInt time = ++timestamp;
|
||||||
if (time == 0) {
|
if (time == 0) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
/* damn, we overflowed */
|
/* damn, we overflowed */
|
||||||
for (i = 0; i < GC_MAVARS_HASH_SIZE; i++)
|
for (i = 0; i < GC_MAVARS_HASH_SIZE; i++)
|
||||||
gc_ma_hash_table[i].timestmp = 0;
|
gc_ma_hash_table[i].timestmp = 0L;
|
||||||
time = ++timestamp;
|
time = ++timestamp;
|
||||||
}
|
}
|
||||||
gc_ma_h_top = top;
|
gc_ma_h_top = top;
|
||||||
@ -1450,12 +1451,13 @@ mark_environments(CELL_PTR gc_ENV, OPREG size, CELL *pvbmap)
|
|||||||
len++;
|
len++;
|
||||||
mynext = prox;
|
mynext = prox;
|
||||||
}
|
}
|
||||||
if (len>=15)
|
if (len>=15) {
|
||||||
(chain[15])++;
|
(chain[15])++;
|
||||||
else
|
} else {
|
||||||
(chain[len])++;
|
(chain[len])++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
mark_external_reference(saved_var);
|
mark_external_reference(saved_var);
|
||||||
}
|
}
|
||||||
@ -1595,7 +1597,7 @@ mark_trail(tr_fr_ptr trail_ptr, tr_fr_ptr trail_base, CELL *gc_H, choiceptr gc_B
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
if (!gc_lookup_ma_var(cptr, trail_base)) {
|
if (!gc_lookup_ma_var(cptr, trail_base)) {
|
||||||
/* first time we see it*/
|
/* check whether this is the first time we see it*/
|
||||||
if (HEAP_PTR(trail_cell)) {
|
if (HEAP_PTR(trail_cell)) {
|
||||||
/* fool the gc into thinking this is a variable */
|
/* fool the gc into thinking this is a variable */
|
||||||
TrailTerm(trail_base) = (CELL)cptr;
|
TrailTerm(trail_base) = (CELL)cptr;
|
||||||
@ -2240,11 +2242,11 @@ sweep_trail(choiceptr gc_B, tr_fr_ptr old_TR)
|
|||||||
CELL *ptr;
|
CELL *ptr;
|
||||||
CELL old = TrailTerm(trail_ptr+1);
|
CELL old = TrailTerm(trail_ptr+1);
|
||||||
/* be sure we don't overwrite before we read */
|
/* be sure we don't overwrite before we read */
|
||||||
int marked_ptr = MARKED_PTR(&TrailTerm(trail_ptr+2));
|
Int marked_ptr = MARKED_PTR(&TrailTerm(trail_ptr+2));
|
||||||
int marked_old = MARKED_PTR(&TrailTerm(trail_ptr+1));
|
Int marked_old = MARKED_PTR(&TrailTerm(trail_ptr+1));
|
||||||
#ifdef FROZEN_STACKS
|
#ifdef FROZEN_STACKS
|
||||||
int marked_val_old = MARKED_PTR(&TrailVal(trail_ptr+1));
|
Int marked_val_old = MARKED_PTR(&TrailVal(trail_ptr+1));
|
||||||
int marked_val_ptr = MARKED_PTR(&TrailVal(trail_ptr+2));
|
Int marked_val_ptr = MARKED_PTR(&TrailVal(trail_ptr+2));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (marked_ptr)
|
if (marked_ptr)
|
||||||
|
Reference in New Issue
Block a user