fix case where we just clean a single atom, the last one.

This commit is contained in:
Vitor Santos Costa 2011-06-27 22:55:30 +01:00
parent 9d00e3426c
commit 49b3f4e7b6

View File

@ -1393,7 +1393,8 @@ Yap_growheap(int fix_code, UInt in_size, void *cip)
Yap_atom_gc( PASS_REGS1 );
/* check if we have a significant improvement from agc */
if (n > NOfAtoms+ NOfAtoms/10 ||
NOfAtoms > 2*AtomHashTableSize) {
/* +1 = make sure we didn't lose the current atom */
NOfAtoms+1 > 2*AtomHashTableSize) {
res = growatomtable( PASS_REGS1 );
} else {
LOCK(LOCAL_SignalLock);
@ -1405,6 +1406,7 @@ Yap_growheap(int fix_code, UInt in_size, void *cip)
return TRUE;
}
LeaveGrowMode(GrowHeapMode);
if (res)
return res;
}
res=do_growheap(fix_code, in_size, (struct intermediates *)cip, NULL, NULL, NULL PASS_REGS);