From 136968a324add598756dba68e1a890665e943a2a Mon Sep 17 00:00:00 2001 From: vsc Date: Mon, 14 Mar 2005 17:02:40 +0000 Subject: [PATCH] left shifting is a very bad idea if malloc is giving addresses in the upper half. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1266 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- m4/Yap.h.m4 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/m4/Yap.h.m4 b/m4/Yap.h.m4 index 4a4dede0a..631b2f58b 100644 --- a/m4/Yap.h.m4 +++ b/m4/Yap.h.m4 @@ -10,7 +10,7 @@ * File: Yap.h.m4 * * mods: * * comments: main header file for YAP * -* version: $Id: Yap.h.m4,v 1.80 2005-03-02 18:35:49 vsc Exp $ * +* version: $Id: Yap.h.m4,v 1.81 2005-03-14 17:02:40 vsc Exp $ * *************************************************************************/ #include "config.h" @@ -784,8 +784,18 @@ Inline(IsUnboundVar, int, Term *, t, *(t) == (Term)(t)) Inline(PtrOfTerm, CELL *, Term, t, *(CELL *)(t)) Inline(FunctorOfTerm, Functor, Term, t, *RepAppl(t)) +#if USE_SYSTEM_MALLOC || USE_DL_MALLOC +#if USE_LOW32_TAGS +Inline(MkAtomTerm, Term, Atom, a, (AtomTag | (CELL)(a))) +Destructor(Term, AtomOf, Atom, t, (~AtomTag & (CELL)(t))) +#else +Inline(MkAtomTerm, Term, Atom, a, TAGGEDA(AtomTag, (CELL)(a))) +Destructor(Term, AtomOf, Atom, t, NonTagPart(t)) +#endif +#else Inline(MkAtomTerm, Term, Atom, a, TAGGEDA(AtomTag, (CELL)(a)-HEAP_INIT_BASE)) Destructor(Term, AtomOf, Atom, t, HEAP_INIT_BASE+NonTagPart(t)) +#endif Inline(IsAtomTerm, int, Term, t, CHKTAG((t), AtomTag)) Inline(MkIntTerm, Term, Int, n, TAGGED(NumberTag, (n)))