more saved state fixes
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2185 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
f37bc03304
commit
a8fe6a668e
@ -10,8 +10,11 @@
|
|||||||
* File: c_interface.c *
|
* File: c_interface.c *
|
||||||
* comments: c_interface primitives definition *
|
* comments: c_interface primitives definition *
|
||||||
* *
|
* *
|
||||||
* Last rev: $Date: 2008-03-22 23:35:00 $,$Author: vsc $ *
|
* Last rev: $Date: 2008-04-01 15:31:41 $,$Author: vsc $ *
|
||||||
* $Log: not supported by cvs2svn $
|
* $Log: not supported by cvs2svn $
|
||||||
|
* Revision 1.108 2008/03/22 23:35:00 vsc
|
||||||
|
* fix bug in all_calls
|
||||||
|
*
|
||||||
* Revision 1.107 2008/03/13 18:41:50 vsc
|
* Revision 1.107 2008/03/13 18:41:50 vsc
|
||||||
* -q flag
|
* -q flag
|
||||||
*
|
*
|
||||||
@ -1652,7 +1655,7 @@ YAP_Init(YAP_init_args *yap_init)
|
|||||||
|
|
||||||
Yap_argv = yap_init->Argv;
|
Yap_argv = yap_init->Argv;
|
||||||
Yap_argc = yap_init->Argc;
|
Yap_argc = yap_init->Argc;
|
||||||
if (yap_init->SavedState != NULL &&
|
if (yap_init->SavedState != NULL ||
|
||||||
yap_init->YapPrologBootFile == NULL) {
|
yap_init->YapPrologBootFile == NULL) {
|
||||||
if (Yap_SavedInfo (yap_init->SavedState, yap_init->YapLibDir, &Trail, &Stack, &Heap) != 1) {
|
if (Yap_SavedInfo (yap_init->SavedState, yap_init->YapLibDir, &Trail, &Stack, &Heap) != 1) {
|
||||||
yap_init->ErrorNo = Yap_Error_TYPE;
|
yap_init->ErrorNo = Yap_Error_TYPE;
|
||||||
|
@ -522,7 +522,8 @@ InitPlIO (void)
|
|||||||
for (i = 0; i < MaxStreams; ++i)
|
for (i = 0; i < MaxStreams; ++i)
|
||||||
Stream[i].status = Free_Stream_f;
|
Stream[i].status = Free_Stream_f;
|
||||||
/* alloca alias array */
|
/* alloca alias array */
|
||||||
FileAliases = (AliasDesc)Yap_AllocCodeSpace(sizeof(struct AliasDescS)*ALIASES_BLOCK_SIZE);
|
if (!FileAliases)
|
||||||
|
FileAliases = (AliasDesc)Yap_AllocCodeSpace(sizeof(struct AliasDescS)*ALIASES_BLOCK_SIZE);
|
||||||
InitStdStreams();
|
InitStdStreams();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
C/save.c
1
C/save.c
@ -1012,6 +1012,7 @@ restore_heap_regs(void)
|
|||||||
*((YAP_SEG_SIZE *) HeapTop) = InUseFlag;
|
*((YAP_SEG_SIZE *) HeapTop) = InUseFlag;
|
||||||
}
|
}
|
||||||
HeapMax = Yap_heap_regs->heap_used = OldHeapUsed;
|
HeapMax = Yap_heap_regs->heap_used = OldHeapUsed;
|
||||||
|
HeapLim = Yap_GlobalBase;
|
||||||
restore_codes();
|
restore_codes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
24
H/rheap.h
24
H/rheap.h
@ -11,8 +11,11 @@
|
|||||||
* File: rheap.h *
|
* File: rheap.h *
|
||||||
* comments: walk through heap code *
|
* comments: walk through heap code *
|
||||||
* *
|
* *
|
||||||
* Last rev: $Date: 2008-04-01 14:09:43 $,$Author: vsc $ *
|
* Last rev: $Date: 2008-04-01 15:31:43 $,$Author: vsc $ *
|
||||||
* $Log: not supported by cvs2svn $
|
* $Log: not supported by cvs2svn $
|
||||||
|
* Revision 1.90 2008/04/01 14:09:43 vsc
|
||||||
|
* improve restore
|
||||||
|
*
|
||||||
* Revision 1.89 2008/04/01 09:41:05 vsc
|
* Revision 1.89 2008/04/01 09:41:05 vsc
|
||||||
* more fixes to restore
|
* more fixes to restore
|
||||||
*
|
*
|
||||||
@ -437,9 +440,6 @@ static void
|
|||||||
restore_codes(void)
|
restore_codes(void)
|
||||||
{
|
{
|
||||||
Yap_heap_regs->heap_top = AddrAdjust(OldHeapTop);
|
Yap_heap_regs->heap_top = AddrAdjust(OldHeapTop);
|
||||||
if (Yap_heap_regs->heap_lim) {
|
|
||||||
Yap_heap_regs->heap_lim = GlobalAddrAdjust(Yap_heap_regs->heap_lim);
|
|
||||||
}
|
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
Yap_heap_regs->seq_def = TRUE;
|
Yap_heap_regs->seq_def = TRUE;
|
||||||
Yap_heap_regs->getwork_code.opc = Yap_opcode(_getwork);
|
Yap_heap_regs->getwork_code.opc = Yap_opcode(_getwork);
|
||||||
@ -776,13 +776,27 @@ restore_codes(void)
|
|||||||
Yap_heap_regs->arg_module = AtomTermAdjust(Yap_heap_regs->arg_module);
|
Yap_heap_regs->arg_module = AtomTermAdjust(Yap_heap_regs->arg_module);
|
||||||
Yap_heap_regs->swi_module = AtomTermAdjust(Yap_heap_regs->swi_module);
|
Yap_heap_regs->swi_module = AtomTermAdjust(Yap_heap_regs->swi_module);
|
||||||
Yap_heap_regs->global_hold_entry = HoldEntryAdjust(Yap_heap_regs->global_hold_entry);
|
Yap_heap_regs->global_hold_entry = HoldEntryAdjust(Yap_heap_regs->global_hold_entry);
|
||||||
if (Yap_heap_regs->file_aliases != NULL) {
|
if (Yap_heap_regs->yap_streams != NULL) {
|
||||||
|
int sno;
|
||||||
|
|
||||||
Yap_heap_regs->yap_streams =
|
Yap_heap_regs->yap_streams =
|
||||||
(struct stream_desc *)AddrAdjust((ADDR)Yap_heap_regs->yap_streams);
|
(struct stream_desc *)AddrAdjust((ADDR)Yap_heap_regs->yap_streams);
|
||||||
|
for (sno = 0; sno < MaxStreams; ++sno) {
|
||||||
|
if (Stream[sno].status & Free_Stream_f)
|
||||||
|
continue;
|
||||||
|
if (Stream[sno].status & (Socket_Stream_f|Pipe_Stream_f|InMemory_Stream_f))
|
||||||
|
continue;
|
||||||
|
Stream[sno].u.file.user_name = AtomTermAdjust(Stream[sno].u.file.user_name);
|
||||||
|
Stream[sno].u.file.name = AtomAdjust(Stream[sno].u.file.name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (Yap_heap_regs->file_aliases != NULL) {
|
if (Yap_heap_regs->file_aliases != NULL) {
|
||||||
|
int i;
|
||||||
|
|
||||||
Yap_heap_regs->file_aliases =
|
Yap_heap_regs->file_aliases =
|
||||||
(struct AliasDescS *)AddrAdjust((ADDR)Yap_heap_regs->file_aliases);
|
(struct AliasDescS *)AddrAdjust((ADDR)Yap_heap_regs->file_aliases);
|
||||||
|
for (i = 0; i < NOfFileAliases; i++)
|
||||||
|
FileAliases[i].name = AtomAdjust(FileAliases[i].name);
|
||||||
}
|
}
|
||||||
if (Yap_heap_regs->yap_lib_dir) {
|
if (Yap_heap_regs->yap_lib_dir) {
|
||||||
Yap_heap_regs->yap_lib_dir =
|
Yap_heap_regs->yap_lib_dir =
|
||||||
|
Reference in New Issue
Block a user