Merge branch 'master' of git://yap.git.sourceforge.net/gitroot/yap/yap-6.3

This commit is contained in:
Joao 2011-04-18 15:01:53 +01:00
commit 3ebfafc36b
4 changed files with 20 additions and 2 deletions

View File

@ -2068,6 +2068,11 @@ Yap_absmi(int inp)
#endif /* FROZEN_STACKS */ #endif /* FROZEN_STACKS */
if (IN_BETWEEN(H0,pt1,H) && IsAttVar(pt1)) if (IN_BETWEEN(H0,pt1,H) && IsAttVar(pt1))
goto failloop; goto failloop;
#ifdef FROZEN_STACKS /* TRAIL */
/* don't reset frozen variables */
if (pt0 < TR_FZ)
goto failloop;
#endif
flags = *pt1; flags = *pt1;
#if MULTIPLE_STACKS #if MULTIPLE_STACKS
if (FlagOn(DBClMask, flags)) { if (FlagOn(DBClMask, flags)) {

View File

@ -153,6 +153,7 @@ call_malloc(unsigned long int size)
char * char *
Yap_AllocCodeSpace(unsigned long int size) Yap_AllocCodeSpace(unsigned long int size)
{ {
size = AdjustSize(size);
return call_malloc(size); return call_malloc(size);
} }
@ -186,6 +187,7 @@ call_realloc(char *p, unsigned long int size)
char * char *
Yap_ReallocCodeSpace(char *p, unsigned long int size) Yap_ReallocCodeSpace(char *p, unsigned long int size)
{ {
size = AdjustSize(size);
return call_realloc(p, size); return call_realloc(p, size);
} }
@ -211,6 +213,7 @@ Yap_FreeCodeSpace(char *p)
char * char *
Yap_AllocAtomSpace(unsigned long int size) Yap_AllocAtomSpace(unsigned long int size)
{ {
size = AdjustSize(size);
return call_malloc(size); return call_malloc(size);
} }

View File

@ -170,8 +170,10 @@ CloseMmappedArray(StaticArrayEntry *pp, void *area USES_REGS)
optr = ptr; optr = ptr;
} }
if (ptr == NULL) { if (ptr == NULL) {
#if !defined(USE_SYSTEM_MALLOC)
Yap_Error(SYSTEM_ERROR,ARG1,"close_mmapped_array (array chain incoherent)", strerror(errno)); Yap_Error(SYSTEM_ERROR,ARG1,"close_mmapped_array (array chain incoherent)", strerror(errno));
return(FALSE); #endif
return FALSE;
} }
if (munmap(ptr->start, ptr->size) == -1) { if (munmap(ptr->start, ptr->size) == -1) {
Yap_Error(SYSTEM_ERROR,ARG1,"close_mmapped_array (munmap: %s)", strerror(errno)); Yap_Error(SYSTEM_ERROR,ARG1,"close_mmapped_array (munmap: %s)", strerror(errno));
@ -1240,7 +1242,11 @@ p_close_static_array( USES_REGS1 )
#if HAVE_MMAP #if HAVE_MMAP
if (ptr->ValueOfVE.chars < (char *)Yap_HeapBase || if (ptr->ValueOfVE.chars < (char *)Yap_HeapBase ||
ptr->ValueOfVE.chars > (char *)HeapTop) { ptr->ValueOfVE.chars > (char *)HeapTop) {
return(CloseMmappedArray(ptr, (void *)ptr->ValueOfVE.chars PASS_REGS)); Int val = CloseMmappedArray(ptr, (void *)ptr->ValueOfVE.chars PASS_REGS);
#if USE_SYSTEM_MALLOC
if (val)
#endif
return(val);
} }
#endif #endif
Yap_FreeAtomSpace((char *)(ptr->ValueOfVE.ints)); Yap_FreeAtomSpace((char *)(ptr->ValueOfVE.ints));

View File

@ -1018,6 +1018,9 @@ init_stack(int arity, CELL *pt, int top, choiceptr saved_b USES_REGS)
YENV[E_CP] = (CELL)P; YENV[E_CP] = (CELL)P;
YENV[E_CB] = (CELL)B; YENV[E_CB] = (CELL)B;
YENV[E_E] = (CELL)ENV; YENV[E_E] = (CELL)ENV;
#ifdef TABLING
YENV[E_B] = (CELL)B;
#endif
#ifdef DEPTH_LIMIT #ifdef DEPTH_LIMIT
YENV[E_DEPTH] = DEPTH; YENV[E_DEPTH] = DEPTH;
#endif #endif
@ -1621,6 +1624,7 @@ Yap_InitYaamRegs(void)
if (Yap_AttsSize > (Yap_LocalBase-Yap_GlobalBase)/8) if (Yap_AttsSize > (Yap_LocalBase-Yap_GlobalBase)/8)
Yap_AttsSize = (Yap_LocalBase-Yap_GlobalBase)/8; Yap_AttsSize = (Yap_LocalBase-Yap_GlobalBase)/8;
H = H0 = ((CELL *) Yap_GlobalBase)+ Yap_AttsSize/sizeof(CELL); H = H0 = ((CELL *) Yap_GlobalBase)+ Yap_AttsSize/sizeof(CELL);
RESET_VARIABLE(H0-1);
LCL0 = ASP = (CELL *) Yap_LocalBase; LCL0 = ASP = (CELL *) Yap_LocalBase;
/* notice that an initial choice-point and environment /* notice that an initial choice-point and environment
*must* be created since for the garbage collector to work */ *must* be created since for the garbage collector to work */