From 2a8854094bdbd098dadad7669792f7bf6d2e7004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Mon, 29 Nov 2010 18:08:29 +0000 Subject: [PATCH] halt_hooks should not be in save/restore, this will cause trouble. --- H/dglobals.h | 2 ++ H/dhstruct.h | 2 -- H/hglobals.h | 2 ++ H/hstruct.h | 2 -- H/iglobals.h | 2 ++ H/ihstruct.h | 2 -- H/rglobals.h | 2 ++ H/rheap.h | 12 ------------ H/rhstruct.h | 2 -- misc/GLOBALS | 3 +++ misc/HEAPFIELDS | 3 --- 11 files changed, 11 insertions(+), 23 deletions(-) diff --git a/H/dglobals.h b/H/dglobals.h index 31d5a6ebd..b65cf8a51 100644 --- a/H/dglobals.h +++ b/H/dglobals.h @@ -217,3 +217,5 @@ #define Yap_PL_Argc Yap_global->pl_argc #define Yap_PL_Argv Yap_global->pl_argv +#define Yap_HaltHooks Yap_global->yap_halt_hook + diff --git a/H/dhstruct.h b/H/dhstruct.h index 19249f0ba..6be01d069 100644 --- a/H/dhstruct.h +++ b/H/dhstruct.h @@ -263,8 +263,6 @@ #define Stream Yap_heap_regs->yap_streams -#define Yap_HaltHooks Yap_heap_regs->yap_halt_hook - #define NOfFileAliases Yap_heap_regs->n_of_file_aliases #define SzOfFileAliases Yap_heap_regs->sz_of_file_aliases #define FileAliases Yap_heap_regs->file_aliases diff --git a/H/hglobals.h b/H/hglobals.h index e825d712d..c14707c6f 100644 --- a/H/hglobals.h +++ b/H/hglobals.h @@ -218,4 +218,6 @@ typedef struct worker_shared { int initialised_from_pl; int pl_argc; char **pl_argv; + + struct halt_hook *yap_halt_hook; } w_shared; diff --git a/H/hstruct.h b/H/hstruct.h index a9f44a7d6..99b06b296 100644 --- a/H/hstruct.h +++ b/H/hstruct.h @@ -263,8 +263,6 @@ struct stream_desc *yap_streams; - struct halt_hook *yap_halt_hook; - UInt n_of_file_aliases; UInt sz_of_file_aliases; struct AliasDescS *file_aliases; diff --git a/H/iglobals.h b/H/iglobals.h index 08cf8a73c..24e0db95d 100644 --- a/H/iglobals.h +++ b/H/iglobals.h @@ -216,4 +216,6 @@ static void InitGlobal(void) { Yap_global->initialised_from_pl = FALSE; Yap_global->pl_argc = 0; Yap_global->pl_argv = NULL; + + Yap_global->yap_halt_hook = NULL; } diff --git a/H/ihstruct.h b/H/ihstruct.h index e0f4c3e3d..a9e12a561 100644 --- a/H/ihstruct.h +++ b/H/ihstruct.h @@ -263,8 +263,6 @@ Yap_heap_regs->yap_streams = NULL; - Yap_heap_regs->yap_halt_hook = NULL; - Yap_heap_regs->n_of_file_aliases = 0; Yap_heap_regs->sz_of_file_aliases = 0; Yap_heap_regs->file_aliases = NULL; diff --git a/H/rglobals.h b/H/rglobals.h index 06fcdd842..304992160 100644 --- a/H/rglobals.h +++ b/H/rglobals.h @@ -216,4 +216,6 @@ static void RestoreGlobal(void) { + + } diff --git a/H/rheap.h b/H/rheap.h index a4c978728..127a32fd4 100755 --- a/H/rheap.h +++ b/H/rheap.h @@ -903,18 +903,6 @@ RestoreDBErasedIList(void) } } -static void -RestoreHaltHooks(void) -{ - struct halt_hook *hooke = Yap_HaltHooks = HaltHookAdjust(Yap_HaltHooks); - - while (hooke) { - hooke->next = HaltHookAdjust(hooke->next); - hooke = hooke->next; - } -} - - static void RestoreStreams(void) { diff --git a/H/rhstruct.h b/H/rhstruct.h index 688edfe8b..5e04e4521 100644 --- a/H/rhstruct.h +++ b/H/rhstruct.h @@ -263,8 +263,6 @@ RestoreStreams(); - RestoreHaltHooks(); - RestoreAliases(); diff --git a/misc/GLOBALS b/misc/GLOBALS index 8d1d2e35b..c1df5ec57 100644 --- a/misc/GLOBALS +++ b/misc/GLOBALS @@ -245,5 +245,8 @@ int initialised_from_pl Yap_InitialisedFromPL =FALSE int pl_argc Yap_PL_Argc =0 char **pl_argv Yap_PL_Argv =NULL +// halt hooks +struct halt_hook *yap_halt_hook Yap_HaltHooks =NULL + END_WORKER_SHARED diff --git a/misc/HEAPFIELDS b/misc/HEAPFIELDS index 6a5824733..a1ba72fa4 100644 --- a/misc/HEAPFIELDS +++ b/misc/HEAPFIELDS @@ -295,9 +295,6 @@ struct operator_entry *op_list OpList =NULL OpListAdjust /* stream array */ struct stream_desc *yap_streams Stream =NULL RestoreStreams() -/* halt hooks */ -struct halt_hook *yap_halt_hook Yap_HaltHooks =NULL RestoreHaltHooks() - /* stream aliases */ UInt n_of_file_aliases NOfFileAliases =0 void UInt sz_of_file_aliases SzOfFileAliases =0 void