From 1a2d89a4230b50e076cafac35a8727d4cdb4142d Mon Sep 17 00:00:00 2001 From: vsc Date: Wed, 23 Jan 2008 18:25:19 +0000 Subject: [PATCH] fix aux allocation git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2056 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/alloc.c | 6 +++++- changes-5.1.html | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/C/alloc.c b/C/alloc.c index c88655033..a85d59db0 100644 --- a/C/alloc.c +++ b/C/alloc.c @@ -12,7 +12,7 @@ * Last rev: * * mods: * * comments: allocating space * -* version:$Id: alloc.c,v 1.87 2008-01-23 17:57:44 vsc Exp $ * +* version:$Id: alloc.c,v 1.88 2008-01-23 18:25:19 vsc Exp $ * *************************************************************************/ #ifdef SCCS static char SccsId[] = "%W% %G%"; @@ -195,6 +195,7 @@ Yap_ExpandPreAllocCodeSpace(UInt sz0, void *cip) Yap_PrologMode |= MallocMode; } Yap_PrologMode &= ~MallocMode; + ScratchPad.sz = ScratchPad.msz = sz; ScratchPad.ptr = ptr; AuxSp = (CELL *)(AuxTop = ptr+sz); return ptr; @@ -655,6 +656,9 @@ Yap_AllocCodeSpace(unsigned int size) ADDR Yap_ExpandPreAllocCodeSpace(UInt sz, void *cip) { + if (sz < SCRATCH_INC_SIZE) + sz = SCRATCH_INC_SIZE; + sz = AdjustLargePageSize(sz+sz/4); if (!Yap_growheap((cip!=NULL), sz, cip)) { Yap_Error(OUT_OF_HEAP_ERROR, TermNil, Yap_ErrorMessage); return NULL; diff --git a/changes-5.1.html b/changes-5.1.html index 1e6501931..0008530c8 100644 --- a/changes-5.1.html +++ b/changes-5.1.html @@ -17,6 +17,7 @@

Yap-5.1.3: