diff --git a/C/init.c b/C/init.c index 5b7a1ce1c..8fc4ddd42 100755 --- a/C/init.c +++ b/C/init.c @@ -1097,6 +1097,7 @@ void init_yapor_workers(void) { worker_id = proc; Yap_remap_optyap_memory(); LOCAL = REMOTE(worker_id); + memcpy(REMOTE(worker_id),REMOTE(0),sizeof(struct worker_local)); InitWorker(worker_id); break; } else diff --git a/C/scanner.c b/C/scanner.c index 6bb00e9db..240af48e2 100755 --- a/C/scanner.c +++ b/C/scanner.c @@ -855,9 +855,9 @@ Yap_tokenizer(IOSTREAM *inp_stream, Term *tposp) ch = getchr(inp_stream); } if (ASP-H < 1024) { - Yap_ErrorMessage = "Stack Overflow"; - Yap_Error_TYPE = OUT_OF_STACK_ERROR; - Yap_Error_Size = 0L; + LOCAL_ErrorMessage = "Stack Overflow"; + LOCAL_Error_TYPE = OUT_OF_STACK_ERROR; + LOCAL_Error_Size = 0L; if (p) p->Tok = Ord(kind = eot_tok); /* serious error now */ @@ -1171,9 +1171,9 @@ Yap_tokenizer(IOSTREAM *inp_stream, Term *tposp) ch = getchr(inp_stream); } if (ASP-H < 1024) { - Yap_ErrorMessage = "Stack Overflow"; - Yap_Error_TYPE = OUT_OF_STACK_ERROR; - Yap_Error_Size = 0L; + LOCAL_ErrorMessage = "Stack Overflow"; + LOCAL_Error_TYPE = OUT_OF_STACK_ERROR; + LOCAL_Error_Size = 0L; if (p) p->Tok = Ord(kind = eot_tok); /* serious error now */ diff --git a/H/ilocals.h b/H/ilocals.h index 88de5a1f2..cd030df76 100644 --- a/H/ilocals.h +++ b/H/ilocals.h @@ -129,24 +129,24 @@ static void InitWorker(int wid) { INIT_LOCK(REMOTE_SignalLock(wid)); #endif - REMOTE_LocalBase(wid) = REMOTE_LocalBase(0); - REMOTE_GlobalBase(wid) = REMOTE_GlobalBase(0); - REMOTE_TrailBase(wid) = REMOTE_TrailBase(0); - REMOTE_TrailTop(wid) = REMOTE_TrailTop(0); - REMOTE_ErrorMessage(wid) = REMOTE_ErrorMessage(0); - REMOTE_Error_Term(wid) = REMOTE_Error_Term(0); + + + + + + #ifdef THREADS - REMOTE_Error_TYPE(wid) = REMOTE_Error_TYPE(0); + #else - REMOTE_Error_TYPE(wid) = REMOTE_Error_TYPE(0); + #endif - REMOTE_Error_Size(wid) = REMOTE_Error_Size(0); - REMOTE_tokptr(wid) = REMOTE_tokptr(0); - REMOTE_toktide(wid) = REMOTE_toktide(0); - REMOTE_VarTable(wid) = REMOTE_VarTable(0); - REMOTE_AnonVarTable(wid) = REMOTE_AnonVarTable(0); + + + + + diff --git a/misc/LOCALS b/misc/LOCALS index 2d503f4f3..f5b8e50f6 100644 --- a/misc/LOCALS +++ b/misc/LOCALS @@ -146,24 +146,24 @@ lockvar SignalLock MkLock #endif // Variables related to memory allocation -ADDR LocalBase =REMOTE_LocalBase(0) -ADDR GlobalBase =REMOTE_GlobalBase(0) -ADDR TrailBase =REMOTE_TrailBase(0) -ADDR TrailTop =REMOTE_TrailTop(0) -char* ErrorMessage =REMOTE_ErrorMessage(0) -Term Error_Term =REMOTE_Error_Term(0) +ADDR LocalBase void +ADDR GlobalBase void +ADDR TrailBase void +ADDR TrailTop void +char* ErrorMessage void +Term Error_Term void #ifdef THREADS -Term Error_TYPE =REMOTE_Error_TYPE(0) +Term Error_TYPE void #else -yap_error_number Error_TYPE =REMOTE_Error_TYPE(0) +yap_error_number Error_TYPE void #endif -UInt Error_Size =REMOTE_Error_Size(0) +UInt Error_Size void char ErrorSay[MAX_ERROR_MSG_SIZE] void jmp_buf IOBotch void -TokEntry* tokptr =REMOTE_tokptr(0) -TokEntry* toktide =REMOTE_toktide(0) -VarEntry* VarTable =REMOTE_VarTable(0) -VarEntry* AnonVarTable =REMOTE_AnonVarTable(0) +TokEntry* tokptr void +TokEntry* toktide void +VarEntry* VarTable void +VarEntry* AnonVarTable void sigjmp_buf RestartEnv void char FileNameBuf[YAP_FILENAME_MAX] void char FileNameBuf2[YAP_FILENAME_MAX] void diff --git a/packages/chr b/packages/chr index b2eb894ce..bf6525f85 160000 --- a/packages/chr +++ b/packages/chr @@ -1 +1 @@ -Subproject commit b2eb894ce3e41925070215f800d6df3a356dc29d +Subproject commit bf6525f85cfcf3c08fff8cf91fb189fe71dc34fd