From 8ea17007f07ff96171254897270e32fb96f356b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Wed, 4 Mar 2015 09:46:55 +0000 Subject: [PATCH] make var names available as a global var --- H/dlocals.h | 2 ++ H/hlocals.h | 1 + H/ilocals.h | 1 + H/rlocals.h | 1 + misc/LOCALS | 1 + 5 files changed, 6 insertions(+) diff --git a/H/dlocals.h b/H/dlocals.h index 4d5155c2c..110e80882 100644 --- a/H/dlocals.h +++ b/H/dlocals.h @@ -78,6 +78,8 @@ #define LOCAL_ConsultLow LOCAL->ConsultLow_ #define REMOTE_ConsultLow(wid) REMOTE(wid)->ConsultLow_ +#define LOCAL_VarNames LOCAL->VarNames_ +#define REMOTE_VarNames(wid) REMOTE(wid)->VarNames_ #define LOCAL_GlobalArena LOCAL->GlobalArena_ #define REMOTE_GlobalArena(wid) REMOTE(wid)->GlobalArena_ diff --git a/H/hlocals.h b/H/hlocals.h index a6683295d..711b48ec3 100644 --- a/H/hlocals.h +++ b/H/hlocals.h @@ -45,6 +45,7 @@ typedef struct worker_local { union CONSULT_OBJ* ConsultBase_; union CONSULT_OBJ* ConsultLow_; + Term VarNames_; Term GlobalArena_; UInt GlobalArenaOverflows_; diff --git a/H/ilocals.h b/H/ilocals.h index e63071738..b8fdcbcf0 100755 --- a/H/ilocals.h +++ b/H/ilocals.h @@ -45,6 +45,7 @@ static void InitWorker(int wid) { REMOTE_ConsultBase(wid) = NULL; REMOTE_ConsultLow(wid) = NULL; + REMOTE_VarNames(wid) = ((Term)0); REMOTE_GlobalArena(wid) = 0L; REMOTE_GlobalArenaOverflows(wid) = 0L; diff --git a/H/rlocals.h b/H/rlocals.h index 48034f477..19eea3ef0 100644 --- a/H/rlocals.h +++ b/H/rlocals.h @@ -44,6 +44,7 @@ static void RestoreWorker(int wid USES_REGS) { + REMOTE_GlobalArena(wid) = TermToGlobalOrAtomAdjust(REMOTE_GlobalArena(wid)); diff --git a/misc/LOCALS b/misc/LOCALS index 814195548..48df57e3b 100755 --- a/misc/LOCALS +++ b/misc/LOCALS @@ -45,6 +45,7 @@ UInt ConsultCapacity void union CONSULT_OBJ* ConsultBase =NULL /* low-water mark for consult */ union CONSULT_OBJ* ConsultLow =NULL +Term VarNames =((Term)0) //global variables Term GlobalArena =0L TermToGlobalOrAtomAdjust