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:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								C/heapgc.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								C/heapgc.c
									
									
									
									
									
								
							@@ -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));
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -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.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user