port to OS/X

fix shunting trail entries.


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@26 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2001-05-07 13:53:19 +00:00
parent 3e0d96844f
commit 171b6043a5
3 changed files with 11 additions and 6 deletions

View File

@ -12,7 +12,7 @@
* Last rev: *
* mods: *
* comments: allocating space *
* version:$Id: alloc.c,v 1.4 2001-05-03 18:48:06 vsc Exp $ *
* version:$Id: alloc.c,v 1.5 2001-05-07 13:53:19 vsc Exp $ *
*************************************************************************/
#ifdef SCCS
static char SccsId[] = "%W% %G%";
@ -590,6 +590,8 @@ ExtendWorkSpace(Int s)
return FALSE;
}
}
a = mmap(WorkSpaceTop, (size_t) s, PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_PRIVATE | MAP_FIXED, fd, 0);
if (close(fd) == -1) {
#if HAVE_STRERROR
Error(SYSTEM_ERROR, TermNil, "mmap could not close file (%s) ]\n", strerror(errno));
@ -598,8 +600,6 @@ ExtendWorkSpace(Int s)
#endif
return FALSE;
}
a = mmap(WorkSpaceTop, (size_t) s, PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_PRIVATE | MAP_FIXED, fd, 0);
#endif
if (a == (MALLOC_T) - 1) {
#if HAVE_STRERROR

View File

@ -89,8 +89,9 @@ gc_lookup_ma_var(CELL *addr, tr_fr_ptr trp) {
live_list = &(gc_ma_hash_table[i].val);
return(NULL);
}
if (gc_ma_hash_table[i].val.addr == addr)
if (gc_ma_hash_table[i].val.addr == addr) {
return(&(gc_ma_hash_table[i].val.trptr));
}
optr = &(gc_ma_hash_table[i].val);
nptr = gc_ma_hash_table[i].val.next;
while (nptr != NULL) {
@ -852,7 +853,7 @@ mark_variable(CELL_PTR current)
}
} else {
/* binding to a determinate reference */
if (next >= HB) {
if (next >= HB && current < LCL0) {
*current = cnext;
total_marked--;
POP_POINTER();
@ -863,7 +864,9 @@ mark_variable(CELL_PTR current)
current = next;
}
}
} else if (IsVarTerm(cnext) && UNMARK_CELL(cnext) != (CELL)next) {
} else if (IsVarTerm(cnext) &&
UNMARK_CELL(cnext) != (CELL)next &&
current < LCL0) {
/* This step is possible because we clean up the trail */
*current = UNMARK_CELL(cnext);
total_marked--;
@ -1297,6 +1300,7 @@ mark_trail(tr_fr_ptr trail_ptr, tr_fr_ptr trail_base, CELL *gc_H, choiceptr gc_B
#if MULTI_ASSIGNMENT_VARIABLES
while (live_list != NULL) {
CELL trail_cell = TrailTerm(live_list->trptr-1);
printf("multi assignment marking cell %p:%x\n", &TrailTerm(live_list->trptr-1), trail_cell);
if (HEAP_PTR(trail_cell)) {
mark_external_reference(&TrailTerm(live_list->trptr-1));
}

View File

@ -6,6 +6,7 @@
<H2 ALIGN=CENTER>Yap-4.3.19:</H2>
<UL>
<LI> FIXED: do not short circuit trail entries.
<LI> FIXED: Patches for memory allocation in Apple's OS/X..
<LI> FIXED: checked whether mmap work right in alloc.c.
<LI> FIXED: ASP from Y should have space for env size.