new interface to access globals. They are not in a file called GLOBALS, from which

we generate several files automatically.
This commit is contained in:
Vitor Santos Costa
2010-03-21 22:12:42 +00:00
parent 499f2c5368
commit d5e1ff38f4
32 changed files with 1453 additions and 777 deletions

View File

@@ -351,7 +351,7 @@ InitExStacks(int Trail, int Stack)
#ifdef THREADS
if (worker_id)
Yap_GlobalBase = (ADDR)ThreadHandle[worker_id].stack_address;
Yap_GlobalBase = (ADDR)MY_ThreadHandle.stack_address;
#endif
Yap_TrailTop = Yap_GlobalBase + pm;
Yap_LocalBase = Yap_GlobalBase + sa;
@@ -385,10 +385,10 @@ Yap_InitExStacks(int Trail, int Stack)
void
Yap_KillStacks(int wid)
{
ADDR gb = ThreadHandle[wid].stack_address;
ADDR gb = FOREIGN_ThreadHandle(wid).stack_address;
if (gb) {
free(gb);
ThreadHandle[wid].stack_address = NULL;
FOREIGN_ThreadHandle(wid).stack_address = NULL;
}
}
#else
@@ -417,7 +417,7 @@ Yap_ExtendWorkSpace(Int s)
if (nbp == NULL)
return FALSE;
#if defined(THREADS)
ThreadHandle[worker_id].stack_address = (char *)nbp;
MY_ThreadHandle.stack_address = (char *)nbp;
#endif
Yap_GlobalBase = (char *)nbp;
return TRUE;