fix atom gc to actually recover first atom in the chain.

This commit is contained in:
Vitor Santos Costa 2010-10-26 10:04:36 +01:00
parent ecd2fab52e
commit d0cd5f3fa3
3 changed files with 18 additions and 1 deletions

View File

@ -126,6 +126,7 @@ AtomAdjust(Atom a)
#define REINIT_LOCK(P)
#define REINIT_RWLOCK(P)
#define NoAGCAtomAdjust(P) (P)
#define OrArgAdjust(P)
#define TabEntryAdjust(P)
#define IntegerAdjust(D) (D)

View File

@ -391,7 +391,7 @@ RestoreAtoms(void)
PtoAtomHashEntryAdjust(Yap_heap_regs->hash_chain);
HashPtr = HashChain;
for (i = 0; i < AtomHashTableSize; ++i) {
HashPtr->Entry = AtomAdjust(HashPtr->Entry);
HashPtr->Entry = NoAGCAtomAdjust(HashPtr->Entry);
RestoreAtomList(HashPtr->Entry);
HashPtr++;
}

View File

@ -320,6 +320,14 @@ AtomAdjust (Atom at)
return (Atom) ((at));
}
inline EXTERN Atom NoAGCAtomAdjust (Atom);
inline EXTERN Atom
NoAGCAtomAdjust (Atom at)
{
return (Atom) ((at));
}
inline EXTERN Prop PropAdjust (Prop);
@ -341,6 +349,14 @@ AtomAdjust (Atom at)
return (Atom) ((at == NULL ? (at) : (Atom) (CharP (at) + HDiff)));
}
inline EXTERN Atom NoAGCAtomAdjust (Atom);
inline EXTERN Atom
NoAGCAtomAdjust (Atom at)
{
return (Atom) ((at == NULL ? (at) : (Atom) (CharP (at) + HDiff)));
}
inline EXTERN Prop PropAdjust (Prop);