fix C/scanner.c. change some misc/LOCALS initializations.

This commit is contained in:
Joao 2011-05-26 15:02:00 +01:00
parent 98e35b16e8
commit f658a99dad
5 changed files with 34 additions and 33 deletions

View File

@ -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

View File

@ -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 */

View File

@ -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);

View File

@ -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

@ -1 +1 @@
Subproject commit b2eb894ce3e41925070215f800d6df3a356dc29d
Subproject commit bf6525f85cfcf3c08fff8cf91fb189fe71dc34fd