change struct worker_share to global_data
change struct global_data to optyap_global_data chnage field global in struct worker_share to optyap_global
This commit is contained in:
parent
6b48f8949f
commit
1cede1f4d6
4
C/init.c
4
C/init.c
@ -1237,9 +1237,9 @@ Yap_CloseScratchPad(void)
|
||||
|
||||
|
||||
#if defined(YAPOR) && !defined(THREADS)
|
||||
struct worker_shared *Yap_global;
|
||||
struct global_data *Yap_global;
|
||||
#else
|
||||
struct worker_shared Yap_Global;
|
||||
struct global_data Yap_Global;
|
||||
#endif
|
||||
|
||||
#if defined(THREADS)
|
||||
|
@ -181,9 +181,9 @@ typedef struct various_codes {
|
||||
#include "hlocals.h"
|
||||
|
||||
#if defined(YAPOR) && !defined(THREADS)
|
||||
extern struct worker_shared *Yap_global;
|
||||
extern struct global_data *Yap_global;
|
||||
#else
|
||||
extern struct worker_shared Yap_Global;
|
||||
extern struct global_data Yap_Global;
|
||||
#define Yap_global (&Yap_Global)
|
||||
#endif
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
||||
#endif
|
||||
|
||||
#if defined(YAPOR) || defined(TABLING)
|
||||
#define GLOBAL Yap_global->global
|
||||
#define GLOBAL Yap_global->optyap_global
|
||||
#define REMOTE Yap_global->remote
|
||||
#endif
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
|
||||
|
||||
typedef struct worker_shared {
|
||||
typedef struct global_data {
|
||||
|
||||
#if THREADS
|
||||
|
||||
@ -56,7 +56,7 @@ typedef struct worker_shared {
|
||||
#endif
|
||||
|
||||
#if defined(YAPOR) || defined(TABLING)
|
||||
struct global_data global;
|
||||
struct optyap_global_data optyap_global;
|
||||
struct local_data remote[MAX_WORKERS];
|
||||
#endif
|
||||
|
||||
|
@ -100,9 +100,9 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
|
||||
|
||||
/* we'll need this later */
|
||||
#if defined(YAPOR) && !defined(THREADS)
|
||||
Yap_global = (struct worker_shared *)( mmap_addr - sizeof(struct worker_shared));
|
||||
Yap_WLocal = (struct worker_local *)( mmap_addr - (sizeof(struct worker_shared)+MAX_WORKERS*sizeof(struct worker_local)));
|
||||
extra_area = ADJUST_SIZE_TO_PAGE(sizeof(struct worker_shared)+MAX_WORKERS*sizeof(struct worker_local));
|
||||
Yap_global = (struct global_data *)( mmap_addr - sizeof(struct global_data));
|
||||
Yap_WLocal = (struct worker_local *)( mmap_addr - (sizeof(struct global_data)+MAX_WORKERS*sizeof(struct worker_local)));
|
||||
extra_area = ADJUST_SIZE_TO_PAGE(sizeof(struct global_data)+MAX_WORKERS*sizeof(struct worker_local));
|
||||
#endif
|
||||
Yap_HeapBase = (ADDR)mmap_addr;
|
||||
Yap_GlobalBase = mmap_addr + HeapArea;
|
||||
|
@ -157,10 +157,10 @@ struct global_locks {
|
||||
|
||||
|
||||
/*********************************
|
||||
** Struct global_data **
|
||||
* Struct optyap_global_data **
|
||||
*********************************/
|
||||
|
||||
struct global_data{
|
||||
struct optyap_global_data{
|
||||
/* global data related to memory management */
|
||||
struct global_pages pages;
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
|
||||
// Stuff that must be shared by all threads or workers
|
||||
START_WORKER_SHARED
|
||||
START_GLOBAL_DATA
|
||||
|
||||
/* multi-thread support */
|
||||
#if THREADS
|
||||
@ -61,7 +61,7 @@ lockvar thread_handles_lock ThreadHandlesLock MkLock
|
||||
|
||||
// Ricardo's stuff
|
||||
#if defined(YAPOR) || defined(TABLING)
|
||||
struct global_data global GLOBAL void
|
||||
struct optyap_global_data optyap_global GLOBAL void
|
||||
struct local_data remote[MAX_WORKERS] REMOTE void
|
||||
#endif
|
||||
|
||||
@ -74,5 +74,5 @@ char **pl_argv Yap_PL_Argv =NULL
|
||||
// halt hooks
|
||||
struct halt_hook *yap_halt_hook Yap_HaltHooks =NULL
|
||||
|
||||
END_WORKER_SHARED
|
||||
END_GLOBAL_DATA
|
||||
|
||||
|
@ -51,10 +51,10 @@ gen_struct(Inp,Out) :-
|
||||
Inp = "END_WORKER_LOCAL", !,
|
||||
Out = "} w_local;".
|
||||
gen_struct(Inp,Out) :-
|
||||
Inp = "START_WORKER_SHARED", !,
|
||||
Out = "typedef struct worker_shared {".
|
||||
Inp = "START_GLOBAL_DATA", !,
|
||||
Out = "typedef struct global_data {".
|
||||
gen_struct(Inp,Out) :-
|
||||
Inp = "END_WORKER_SHARED", !,
|
||||
Inp = "END_GLOBAL_DATA", !,
|
||||
Out = "} w_shared;".
|
||||
gen_struct(Inp,Out) :-
|
||||
Inp = "ATOMS", !,
|
||||
@ -87,10 +87,10 @@ gen_dstruct(Inp,"") :-
|
||||
Inp = "END_WORKER_LOCAL", !,
|
||||
retract(globals(worker)).
|
||||
gen_dstruct(Inp,"") :-
|
||||
Inp = "START_WORKER_SHARED", !,
|
||||
Inp = "START_GLOBAL_DATA", !,
|
||||
assert(globals(all)).
|
||||
gen_dstruct(Inp,"") :-
|
||||
Inp = "END_WORKER_SHARED", !,
|
||||
Inp = "END_GLOBAL_DATA", !,
|
||||
retract(globals(all)).
|
||||
gen_dstruct(Inp,Out) :-
|
||||
Inp = "ATOMS", !,
|
||||
|
Reference in New Issue
Block a user