*** empty log message ***
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1504 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
d1fc8bc59c
commit
331d0d8511
43
C/alloc.c
43
C/alloc.c
@ -12,7 +12,7 @@
|
||||
* Last rev: *
|
||||
* mods: *
|
||||
* comments: allocating space *
|
||||
* version:$Id: alloc.c,v 1.79 2005-12-17 03:25:39 vsc Exp $ *
|
||||
* version:$Id: alloc.c,v 1.80 2006-01-08 23:01:46 vsc Exp $ *
|
||||
*************************************************************************/
|
||||
#ifdef SCCS
|
||||
static char SccsId[] = "%W% %G%";
|
||||
@ -662,10 +662,6 @@ Yap_ExpandPreAllocCodeSpace(UInt sz, void *cip)
|
||||
|
||||
#include "windows.h"
|
||||
|
||||
#define BASE_ADDRESS ((LPVOID) MMAP_ADDR)
|
||||
/* #define MAX_WORKSPACE 0x40000000L */
|
||||
#define MAX_WORKSPACE 0x80000000L
|
||||
|
||||
static LPVOID brk;
|
||||
|
||||
static int
|
||||
@ -674,6 +670,8 @@ ExtendWorkSpace(Int s, int fixed_allocation)
|
||||
LPVOID b = brk;
|
||||
prolog_exec_mode OldPrologMode = Yap_PrologMode;
|
||||
|
||||
|
||||
|
||||
Yap_PrologMode = ExtendStackMode;
|
||||
if (fixed_allocation) {
|
||||
b = VirtualAlloc(b, s, MEM_RESERVE, PAGE_NOACCESS);
|
||||
@ -685,6 +683,7 @@ ExtendWorkSpace(Int s, int fixed_allocation)
|
||||
}
|
||||
if (!b) {
|
||||
Yap_PrologMode = OldPrologMode;
|
||||
/* fprintf(stderr,"NOT OK1: %p--%p\n",b,brk);*/
|
||||
return FALSE;
|
||||
}
|
||||
b = VirtualAlloc(b, s, MEM_COMMIT, PAGE_READWRITE);
|
||||
@ -694,9 +693,11 @@ ExtendWorkSpace(Int s, int fixed_allocation)
|
||||
"VirtualAlloc could not commit %ld bytes",
|
||||
(long int)s);
|
||||
Yap_PrologMode = OldPrologMode;
|
||||
/* fprintf(stderr,"NOT OK2: %p--%p\n",b,brk);*/
|
||||
return FALSE;
|
||||
}
|
||||
brk = (LPVOID) ((Int) brk + s);
|
||||
brk = (LPVOID) ((Int) b + s);
|
||||
/* fprintf(stderr,"OK: %p--%p\n",b,brk);*/
|
||||
Yap_PrologMode = OldPrologMode;
|
||||
return TRUE;
|
||||
}
|
||||
@ -705,35 +706,14 @@ static MALLOC_T
|
||||
InitWorkSpace(Int s)
|
||||
{
|
||||
SYSTEM_INFO si;
|
||||
UInt max_mem = MAX_WORKSPACE;
|
||||
LPVOID b = NULL;
|
||||
|
||||
GetSystemInfo(&si);
|
||||
Yap_page_size = si.dwPageSize;
|
||||
|
||||
s = ((s+ (ALLOC_SIZE-1))/ALLOC_SIZE)*ALLOC_SIZE;
|
||||
brk = NULL;
|
||||
b = VirtualAlloc((LPVOID)MMAP_ADDR, s, MEM_RESERVE, PAGE_NOACCESS);
|
||||
if (b == NULL) {
|
||||
b = VirtualAlloc(NULL, max_mem, MEM_RESERVE, PAGE_NOACCESS);
|
||||
if (!b) {
|
||||
fprintf(stderr,"%% Warning: YAP reserving space at variable address %p\n", brk);
|
||||
return NULL;
|
||||
}
|
||||
b = VirtualAlloc(b, s, MEM_COMMIT, PAGE_READWRITE);
|
||||
if (b== NULL) {
|
||||
fprintf(stderr,"%% Warning: YAP failed to reserve space at %p\n", brk);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
b = VirtualAlloc(b, s, MEM_COMMIT, PAGE_READWRITE);
|
||||
if (!b) {
|
||||
fprintf(stderr,"%% Warning: YAP failed to reserve space at %p\n", brk);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
brk = (LPVOID) ((Int) b + s);
|
||||
return b;
|
||||
brk = (LPVOID)Yap_page_size;
|
||||
if (!ExtendWorkSpace(s,0))
|
||||
return FALSE;
|
||||
return (MALLOC_T)brk-s;
|
||||
}
|
||||
|
||||
int
|
||||
@ -1365,7 +1345,6 @@ Yap_InitMemory(int Trail, int Heap, int Stack)
|
||||
Yap_GlobalBase = Yap_LocalBase - sa;
|
||||
HeapLim = Yap_GlobalBase; /* avoid confusions while
|
||||
* * restoring */
|
||||
|
||||
#if !USE_DL_MALLOC
|
||||
AuxTop = (ADDR)(AuxSp = (CELL *)Yap_GlobalBase);
|
||||
#endif
|
||||
|
6
H/Yap.h
6
H/Yap.h
@ -10,7 +10,7 @@
|
||||
* File: Yap.h.m4 *
|
||||
* mods: *
|
||||
* comments: main header file for YAP *
|
||||
* version: $Id: Yap.h,v 1.11 2005-12-23 00:20:14 vsc Exp $ *
|
||||
* version: $Id: Yap.h,v 1.12 2006-01-08 23:01:47 vsc Exp $ *
|
||||
*************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
@ -250,10 +250,6 @@ extern char Yap_Option[20];
|
||||
#endif
|
||||
#elif __svr4__ || defined(__SVR4)
|
||||
#define MMAP_ADDR 0x02000000
|
||||
#elif defined(_WIN32)
|
||||
#define MMAP_ADDR 0x00480000L
|
||||
#elif defined(__CYGWIN__)
|
||||
#define MMAP_ADDR 0x00480000L
|
||||
#endif
|
||||
#endif /* !IN_SECOND_QUADRANT */
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: chr_translate_bootstrap.pl,v 1.1 2005-10-28 17:41:30 vsc Exp $
|
||||
/* $Id: chr_translate_bootstrap.pl,v 1.2 2006-01-08 23:01:47 vsc Exp $
|
||||
|
||||
Part of CHR (Constraint Handling Rules)
|
||||
|
||||
@ -124,7 +124,10 @@
|
||||
:- use_module(library(lists)).
|
||||
:- use_module(hprolog).
|
||||
:- use_module(library(assoc)).
|
||||
:- write_depth(3,3).
|
||||
%:- start_low_level_trace.
|
||||
:- use_module(pairlist).
|
||||
:- stop_low_level_trace.
|
||||
:- use_module(library(ordsets)).
|
||||
:- include(chr_op).
|
||||
|
||||
|
Reference in New Issue
Block a user