bug fixes on memory overflows and on clauses :- fail being ignored by clause.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1167 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2004-10-27 15:56:34 +00:00
parent bc194d7fcc
commit f267e74737
8 changed files with 238 additions and 342 deletions

View File

@@ -12,7 +12,7 @@
* Last rev: *
* mods: *
* comments: allocating space *
* version:$Id: alloc.c,v 1.61 2004-10-26 20:15:47 vsc Exp $ *
* version:$Id: alloc.c,v 1.62 2004-10-27 15:56:32 vsc Exp $ *
*************************************************************************/
#ifdef SCCS
static char SccsId[] = "%W% %G%";
@@ -494,23 +494,39 @@ FreeCodeSpace(char *p)
FreeBlock(((BlockHeader *) (p - sizeof(YAP_SEG_SIZE))));
}
#if DEBUG_ALLOC
int vsc_mem_trace;
#endif
/* If you need to dinamically allocate space from the heap, this is
* the macro you should use */
void
Yap_FreeCodeSpace(char *p)
{
#if DEBUG_ALLOC
if (vsc_mem_trace)
printf("-%p\n",p);
#endif
FreeCodeSpace(p);
}
char *
Yap_AllocAtomSpace(unsigned int size)
{
return (AllocHeap(size));
char *out = AllocHeap(size);
#if DEBUG_ALLOC
if (vsc_mem_trace) printf("+%p/%d\n",out,size);
#endif
return out;
}
void
Yap_FreeAtomSpace(char *p)
{
#if DEBUG_ALLOC
if (vsc_mem_trace)
printf("-%p\n",p);
#endif
FreeCodeSpace(p);
}
@@ -525,7 +541,11 @@ AllocCodeSpace(unsigned int size)
char *
Yap_AllocCodeSpace(unsigned int size)
{
return AllocCodeSpace(size);
char *out = AllocCodeSpace(size);
#if DEBUG_ALLOC
if (vsc_mem_trace) printf("+%p/%d\n",out,size);
#endif
return out;
}
ADDR