--- Yap-5.0.1.orig/C/save.c 2005-08-25 00:21:48.000000000 +1200 +++ Yap-5.0.1/C/save.c 2006-02-25 00:40:13.000000000 +1300 @@ -463,7 +463,7 @@ { int j; /* Then save the whole heap */ -#if defined(YAPOR) || defined(TABLING) +#if defined(YAPOR) || defined(TABLING) && !defined(YAP_MEMORY_ALLOC_SCHEME) /* skip the local and global data structures */ j = Unsigned(&GLOBAL) - Unsigned(Yap_HeapBase); putout(j); @@ -871,7 +871,7 @@ static int CopyCode(void) { -#if defined(YAPOR) || defined(TABLING) +#if (defined(YAPOR) || defined(TABLING)) && !defined(YAP_MEMORY_ALLOC_SCHEME) /* skip the local and global data structures */ CELL j = get_cell(); if (Yap_ErrorMessage) --- Yap-5.0.1.orig/OPTYap/opt.config.h 2005-08-22 23:09:14.000000000 +1200 +++ Yap-5.0.1/OPTYap/opt.config.h 2006-02-25 00:38:28.000000000 +1300 @@ -26,8 +26,8 @@ /* ----------------------------------------- ** ** memory alloc scheme (define one) ** ** ----------------------------------------- */ -#define SHM_MEMORY_ALLOC_SCHEME 1 -/* #define YAP_MEMORY_ALLOC_SCHEME 1 */ +/* #define SHM_MEMORY_ALLOC_SCHEME 1 */ +#define YAP_MEMORY_ALLOC_SCHEME 1 /* #define MALLOC_MEMORY_ALLOC_SCHEME 1 */ /* ------------------------------------------- ** --- Yap-5.0.1.orig/OPTYap/opt.init.c 2005-08-22 23:09:14.000000000 +1200 +++ Yap-5.0.1/OPTYap/opt.init.c 2006-02-24 22:46:00.000000000 +1300 @@ -159,9 +159,11 @@ void init_local(void) { +#if defined(YAPOR) || defined(THREADS) + LOCAL = REMOTE + worker_id; +#endif #ifdef YAPOR /* local data related to or-parallelism */ - LOCAL = REMOTE + worker_id; LOCAL_top_cp = B_BASE; LOCAL_top_or_fr = GLOBAL_root_or_fr; LOCAL_load = 0; --- Yap-5.0.1.orig/OPTYap/opt.structs.h 2005-08-22 23:09:14.000000000 +1200 +++ Yap-5.0.1/OPTYap/opt.structs.h 2006-02-24 21:29:32.000000000 +1300 @@ -41,7 +41,7 @@ ** ---------------------- */ struct pages { -#ifdef YAPOR +#if defined(YAPOR) || defined(THREADS) lockvar lock; #endif /* YAPOR */ volatile long pages_allocated; @@ -274,9 +274,11 @@ ** --------------------------- */ struct local_data{ +#if defined(YAPOR) || defined(THREADS) + lockvar lock; +#endif #ifdef YAPOR /* local data related to or-parallelism */ - lockvar lock; volatile int load; choiceptr top_choice_point; struct or_frame *top_or_frame; --- Yap-5.0.1.orig/OPTYap/tab.structs.h 2005-08-22 23:09:14.000000000 +1200 +++ Yap-5.0.1/OPTYap/tab.structs.h 2006-02-24 21:49:27.000000000 +1300 @@ -50,7 +50,7 @@ ** ---------------------------- */ typedef struct table_entry { -#ifdef YAPOR +#if defined(YAPOR) || defined(THREADS) lockvar lock; #endif /* YAPOR */ struct pred_entry *pred_entry; @@ -149,8 +149,10 @@ ** ------------------------------ */ typedef struct subgoal_frame { -#ifdef YAPOR +#if defined(YAPOR) || defined(THREADS) lockvar lock; +#endif +#ifdef YAPOR int generator_worker; struct or_frame *top_or_frame_on_generator_branch; #endif /* YAPOR */ @@ -225,8 +227,10 @@ ** --------------------------------- */ typedef struct dependency_frame { -#ifdef YAPOR +#if defined(YAPOR) || defined(THREADS) lockvar lock; +#endif +#ifdef YAPOR int leader_dependency_is_on_stack; struct or_frame *top_or_frame; #ifdef TIMESTAMP_CHECK