ask YAP to get memory step by step in 64 bit maachines.
This commit is contained in:
parent
26706d20ff
commit
d024e9f0ae
26
C/alloc.c
26
C/alloc.c
@ -1595,15 +1595,29 @@ Yap_ExtendWorkSpaceThroughHole(UInt s)
|
||||
WorkSpaceTop = WorkSpaceTop0;
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
#elif SIZEOF_INT_P==8
|
||||
{
|
||||
int n = 1024*1024;
|
||||
while (n) {
|
||||
/* progress 1 MB */
|
||||
WorkSpaceTop += 512*1024;
|
||||
if (ExtendWorkSpace(s, MAP_FIXED)) {
|
||||
Yap_add_memory_hole((ADDR)WorkSpaceTop0, (ADDR)WorkSpaceTop-s);
|
||||
Yap_ErrorMessage = NULL;
|
||||
return WorkSpaceTop-WorkSpaceTop0;
|
||||
}
|
||||
#if defined(_WIN32)
|
||||
/* 487 happens when you step over someone else's memory */
|
||||
if (GetLastError() != 487) {
|
||||
WorkSpaceTop = WorkSpaceTop0;
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
WorkSpaceTop = WorkSpaceTop0;
|
||||
#endif
|
||||
if (ExtendWorkSpace(s, 0)) {
|
||||
Yap_add_memory_hole((ADDR)WorkSpaceTop0, (ADDR)WorkSpaceTop-s);
|
||||
Yap_ErrorMessage = NULL;
|
||||
return WorkSpaceTop-WorkSpaceTop0;
|
||||
}
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user