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