ftp.nice.ch/pub/next/developer/languages/lisp/AKCL.1.599.s.tar.gz#/akcl-1-599/V/c/gbc.c

This is gbc.c in view mode; [Download] [Up]

Changes file for /usr/local/src/kcl/c/gbc.c
Created on Tue Jun 11 09:41:20 1991
Usage \n@s[Original text\n@s|Replacement Text\n@s]
See the file rascal.ics.utexas.edu:/usr2/ftp/merge.c
for a program to merge change files.  Anything not between
"\n@s[" and  "\n@s]" is a simply a comment.
This file was constructed using emacs and  merge.el
Enhancements Copyright (c) W. Schelter All rights reserved.
   by (Bill Schelter)  wfs@carl.ma.utexas.edu 


****Change:(orig (13 13 a))
@s[	IMPLEMENTATION-DEPENDENT
*/

#define	DEBUG


@s|	IMPLEMENTATION-DEPENDENT
*/

#define	DEBUG



@s]


****Change:(orig (14 14 a))
@s[#include "include.h"

@s|#include "include.h"
#include "mp.h"

@s]


****Change:(orig (15 15 a))
@s[

@s|
/* the following in line definitions seem to be twice as fast (at
least on mc68020) as going to the assembly function calls in bitop.c so
since this is more portable and faster lets use them --W. Schelter
These assume that DBEGIN is divisible by 32, or else we should have
#define Shamt(x) (((((int) x -DBEGIN) >> 2) & ~(~0 << 5)))
*/ 

#define Shamt(x) (((((int) x) >> 2) & ~(~0 << 5)))
#define Madr(x) (mark_table+((((int) x) - ((int)DBEGIN)) >> (7)))
#define get_mark_bit(x) (*(Madr(x)) >> Shamt(x) & 1)
#define set_mark_bit(x) ((*(Madr(x))) |= (1 << Shamt(x)))

#ifdef KCLOVM
void mark_all_stacks();
bool ovm_process_created; 
#endif



@s]


****Change:(orig (16 16 a))
@s[bool saving_system;

@s|bool saving_system;
static int gc_time = -1;
static int gc_start = 0;
int runtime();
int sgc_enabled=0;
int  first_protectable_page =0;

@s]


****Change:(orig (17 17 a))
@s[

@s|


@s]


****Change:(orig (22 30 c))
@s[#ifdef AV
#ifdef ATT3B2
#define	page(p)		(((int)(char *)(p)-0x80800000)>>PAGEWIDTH)
#define	pagetochar(x)	((char *)(((x) << PAGEWIDTH) + 0x80800000))

@s,#define	pagetochar(x)	((char *)((x) << PAGEWIDTH))
#endif
#endif

@s|#include "page.h"

@s]


****Change:(orig (31 31 a))
@s[

@s|


@s]


****Change:(orig (49 51 d))
@s[char *heap_end;
char *core_end;


@s|
@s]


****Change:(orig (103 103 d))
@s[enum type what_to_collect;

bool GBC_enable;

@s|enum type what_to_collect;


@s]


****Change:(orig (104 104 a))
@s[

@s|


@s]


****Change:(orig (109 109 a))
@s[		error("too many mark origins");

@s|		error("too many mark origins");
#ifdef SGC
	sgc_type_map[page(p)] |= SGC_PERM_WRITABLE ;
#endif	

@s]


****Change:(orig (126 129 c))
@s[#ifdef AV
	if ((int *)(&x) < cs_limit)
#endif
#ifdef MV

@s|  cs_check(x);

@s]


****Change:(orig (131 133 d))
@s[#endif
		error("control stack overflow in GBC");


@s|
@s]


****Change:(orig (135 138 c))
@s[BEGIN:
	if (x->c.c_car == OBJNULL)
		;
	else if (type_of(x->c.c_car) == t_cons) {

@s|
BEGIN:  
	if (x->c.c_car == OBJNULL) goto MARK_CDR;
	if (type_of(x->c.c_car) == t_cons) {

@s]


****Change:(orig (146 146 a))
@s[		mark_object(x->c.c_car);

@s|		mark_object(x->c.c_car);
MARK_CDR:  

@s]


****Change:(orig (160 160 a))
@s[		return;
	mark_object(x);
}


@s|		return;
	mark_object(x);
}

/* Whenever two arrays are linked together by displacement,
   if one is live, the other will be made live */
#define mark_displaced_field(ar) mark_object(ar->a.a_displaced)


@s]


****Change:(orig (169 176 c))
@s[#ifdef AV
	if ((int *)(&x) < cs_limit)
#endif
#ifdef MV

@s,		error("control stack overflow in GBC");


@s|	cs_check(x);

@s]


****Change:(orig (187 194 d))
@s[	case t_bignum:
	BIGNUM:
		x = (object)(x->big.big_cdr);
		if ((struct bignum *)x == NULL)

@s,		x->d.m = TRUE;
		goto BIGNUM;


@s|
@s]


****Change:(orig (241 241 c))
@s[				       PHTABSIZE*sizeof(object));

@s|				       x->p.p_internal_size*sizeof(object));

@s]


****Change:(orig (244 244 c))
@s[				       PHTABSIZE*sizeof(object));

@s|				       x->p.p_external_size*sizeof(object));

@s]


****Change:(orig (278 285 c))
@s[		if ((y = x->a.a_displaced) != Cnil) {
			/* BUG FIX for marking first word of displaced */
			/* By Nick Gall */
                        y->c.m = TRUE;

@s,			for (y = y->c.c_cdr;  y != Cnil;  y = y->c.c_cdr)
				y->c.m = TRUE;
		}

@s|		if ((x->a.a_displaced) != Cnil)
		  mark_displaced_field(x);

@s]


****Change:(orig (308 311 c))
@s[		if ((enum aelttype)x->a.a_elttype == aet_lf)
			j = sizeof(longfloat)*x->lfa.lfa_dim;
		else
			j = sizeof(fixnum)*x->fixa.fixa_dim;

@s|		/* set j to the size in char of the body of the array */
		
		switch((enum aelttype)x->a.a_elttype){
#define  ROUND_RB_POINTERS_DOUBLE \
{int tem =  ((long)rb_pointer1) & (sizeof(double)-1); \
   if (tem) \
     { rb_pointer +=  (sizeof(double) - tem); \
       rb_pointer1 +=  (sizeof(double) - tem); \
     }}
		case aet_lf:
		  j= sizeof(longfloat)*x->lfa.lfa_dim;
	          if (((int)what_to_collect >= (int)t_contiguous) &&
			!(inheap(cp))) ROUND_RB_POINTERS_DOUBLE;
		  break;
		case aet_char:
		case aet_uchar:
		  j=sizeof(char)*x->a.a_dim;
		  break;
		case aet_short:
		case aet_ushort:
		  j=sizeof(short)*x->a.a_dim;
		  break;
		default:
		  j=sizeof(fixnum)*x->fixa.fixa_dim;}


@s]


****Change:(orig (328 329 c))
@s[			} else if (x->a.a_displaced == Cnil)
				x->a.a_self = (object *)copy_relblock(cp, j);

@s|			} else if (x->a.a_displaced == Cnil) {
#ifdef HAVE_ALLOCA
			  if (cp <= core_end)  /* only if body of array not on C stack */
#endif			  
				x->a.a_self = (object *)copy_relblock(cp, j);}

@s]


****Change:(orig (339 346 c))
@s[		if ((y = x->v.v_displaced) != Cnil) {
			/* BUG FIX for marking first word of displaced */
			/* By Nick Gall */
                        y->c.m = TRUE;

@s,			for (y = y->c.c_cdr;  y != Cnil;  y = y->c.c_cdr)
				y->c.m = TRUE;
		}

@s|		if ((x->v.v_displaced) != Cnil)
		  mark_displaced_field(x);

@s]


****Change:(orig (351 351 a))
@s[		else
			goto CASE_SPECIAL;


@s|		else
			goto CASE_SPECIAL;

        case t_bignum:
		if ((int)what_to_collect >= (int)t_contiguous) {
		  j = x->big.big_length;
		  cp = (char *)(x->big.big_self);
		  if (cp == 0)
		    break;
		  if (j != lg(MP(x))  &&
		      /* we don't bother to zero this register,
			 and its contents may get over written */
		      ! (x == big_register_1 &&
			 (int)(cp) <= top &&
			 (int) cp >= bot))
		    printf("bad length 0x%x ",x);
		  j = j * sizeof(int);
		
		  if (inheap(cp)) {
		    if (what_to_collect == t_contiguous)
		      mark_contblock(cp, j);
		  } else 
		    x->big.big_self = (long *) copy_relblock(cp, j);}
		break;


@s]


****Change:(orig (354 361 c))
@s[		if ((y = x->st.st_displaced) != Cnil) {
			/* BUG FIX for marking first word of displaced */
			/* By Nick Gall */
                        y->c.m = TRUE;

@s,			for (y = y->c.c_cdr;  y != Cnil;  y = y->c.c_cdr)
				y->c.m = TRUE;
		}

@s|		if ((x->st.st_displaced) != Cnil)
		  mark_displaced_field(x);

@s]


****Change:(orig (382 390 c))
@s[		if ((y = x->bv.bv_displaced) != Cnil) {
			/* BUG FIX for marking first word of displaced */
			/* By Nick Gall */
                        y->c.m = TRUE;

@s,		j = (x->bv.bv_offset + x->bv.bv_dim + 7)/8;

@s|		if ((x->bv.bv_displaced) != Cnil)
		  mark_displaced_field(x);
/* We make bitvectors multiple of sizeof(int) in size allocated
 Assume 8 = number of bits in char */

#define W_SIZE (8*sizeof(int))
		j= sizeof(int) *
		   ((x->bv.bv_offset + x->bv.bv_dim + W_SIZE -1)/W_SIZE);

@s]


****Change:(orig (397 397 c))
@s[		mark_object(x->str.str_name);

@s|		mark_object(x->str.str_def);

@s]


****Change:(orig (401 407 c))
@s[		for (i = 0, j = x->str.str_length;  i < j;  i++)
			mark_object(p[i]);
		if ((int)what_to_collect >= (int)t_contiguous) {
			if (inheap(x->str.str_self)) {

@s,						       j*sizeof(object));

@s|		{object def=x->str.str_def;
		 unsigned char * s_type = &SLOT_TYPE(def,0);
		 unsigned short *s_pos= & SLOT_POS(def,0);
		 for (i = 0, j = S_DATA(def)->length;  i < j;  i++)
		   if (s_type[i]==0) mark_object(STREF(object,x,s_pos[i]));
		 if ((int)what_to_collect >= (int)t_contiguous) {
		     if (inheap(x->str.str_self)) {
		       if (what_to_collect == t_contiguous)
			 mark_contblock((char *)p,
					S_DATA(def)->size);

@s]


****Change:(orig (409 412 c))
@s[			} else
				x->str.str_self = (object *)
				copy_relblock((char *)p, j*sizeof(object));
		}

@s|		     } else
		       x->str.str_self = (object *)
			 copy_relblock((char *)p, S_DATA(def)->size);
		   }}

@s]


****Change:(orig (422 422 a))
@s[			mark_object(x->sm.sm_object1);

@s|			mark_object(x->sm.sm_object1);
			if (saving_system)
			  {FILE *fp = x->sm.sm_fp;
			     if (fp != 0 && fp != stdin && fp !=stdout
				 )
			     {fclose(fp);
			      x->sm.sm_fp=0;
			    }}
			else

@s]


****Change:(orig (424 427 c))
@s[			    x->sm.sm_fp != NULL &&
			    x->sm.sm_fp->_base != NULL &&
			    x->sm.sm_fp->_base != BASEFF)
				mark_contblock(x->sm.sm_fp->_base, BUFSIZ);

@s|			    x->sm.sm_fp &&
			    x->sm.sm_buffer)
				mark_contblock(x->sm.sm_buffer, BUFSIZ);

@s]


****Change:(orig (449 449 c))
@s[		case smm_string_output:
			mark_object(x->sm.sm_object0);
			break;


@s|		case smm_string_output:
			mark_object(x->sm.sm_object0);
			break;
#ifdef USER_DEFINED_STREAMS
   	        case smm_user_defined:
			mark_object(x->sm.sm_object0);
			mark_object(x->sm.sm_object1);
			break;
#endif

@s]


****Change:(orig (487 487 a))
@s[		break;

	case t_cfun:

@s|		break;

	case t_cfun:
        case t_sfun:
        case t_vfun:
	case t_gfun:	

@s]


****Change:(orig (490 490 c))
@s[		if (x->cf.cf_start == NULL)

@s|		break;
		
        case t_cfdata:

	        if (x->cfd.cfd_self != NULL)
		  {int i=x->cfd.cfd_fillp;
		   while(i-- > 0)
		     mark_object(x->cfd.cfd_self[i]);}
		if (x->cfd.cfd_start == NULL)

@s]


****Change:(orig (493 493 c))
@s[			if (get_mark_bit((int *)(x->cf.cf_start)))

@s|			if (!MAYBE_DATA_P((x->cfd.cfd_start)) ||
			    get_mark_bit((int *)(x->cfd.cfd_start)))

@s]


****Change:(orig (495 496 c))
@s[			mark_contblock(x->cf.cf_start, x->cf.cf_size);
		}

@s|			mark_contblock(x->cfd.cfd_start, x->cfd.cfd_size);}

@s]


****Change:(orig (498 498 d))
@s[		break;


@s|		break;

@s]


****Change:(orig (502 504 c))
@s[		mark_object(x->cc.cc_data);
		if (x->cc.cc_start == NULL)
			break;

@s|                mark_object(x->cc.cc_data);

@s]


****Change:(orig (506 513 c))
@s[			if (get_mark_bit((int *)(x->cc.cc_start)))
				break;
			mark_contblock(x->cc.cc_start, x->cc.cc_size);
			if (x->cc.cc_turbo != NULL) {

@s,				mark_contblock((char *)(x->cc.cc_turbo),

@s|		  if (x->cc.cc_turbo != NULL) {
		    for (i = 0, y = x->cc.cc_env;
			 type_of(y) == t_cons;
			 i++, y = y->c.c_cdr);
		    mark_contblock((char *)(x->cc.cc_turbo),

@s]


****Change:(orig (521 521 c))
@s[	case t_spice:
		break;


@s|	case t_spice:
		break;
        case t_fat_string:
		mark_fat_string(x);
		break;
        case t_dclosure:
                break;

@s]


****Change:(orig (530 530 a))
@s[		error("mark botch");
	}
}


@s|		error("mark botch");
	}
}

mark_stack_carefully(top,bottom,offset)
int *bottom,*top;
{int p,m,pageoffset;
 object x;
 struct typemanager *tm;
 register int *j;

 /* if either of these happens we are marking the C stack
    and need to use a local */

 if (top==0) top = (int *) &top ;
 if (bottom==0) bottom= (int *)&top;

 /* On machines which align local pointers on multiple of 2 rather
    than 4 we need to mark twice
   */

 if (offset) {mark_stack_carefully(bottom,(((char *) top) +offset),0);}
 for (j=top ; j >= bottom ; j--)
   {if (VALID_DATA_ADDRESS_P(*j)
	&& type_map[(p=page(*j))]< (char)t_end)
      {pageoffset=((char *)*j - pagetochar(p));
       tm=tm_of((enum type) type_map[p]);
       x= (object)
	 ((char *)(*j) -
	  ((pageoffset=((char *)*j - pagetochar(p))) %
	   tm->tm_size));
       if ((pageoffset <  (tm->tm_size * tm->tm_nppage))
	   && (m=x->d.m) != FREE)
       {if (m==TRUE) continue;
	  if (m!=0)
	    {fprintf(stdout,
		     "**bad value %d of d.m in gbc page %d skipping mark**"
		     ,m,p);fflush(stdout);
	     continue;
	   };
	  mark_object(x);}}}}



@s]


****Change:(orig (544 544 a))
@s[	mark_object(Cnil);
	mark_object(Ct);


@s|	mark_object(Cnil);
	mark_object(Ct);

	mark_stack_carefully(vs_top-1,vs_org,0);
	clear_stack(vs_top,vs_limit);
	mark_stack_carefully(MVloc,MVloc+(sizeof(MVloc)/sizeof(object)),0);
	/* 

@s]


****Change:(orig (545 545 a))
@s[	for (p = vs_org;  p < vs_top;  p++) {

@s|	for (p = vs_org;  p < vs_top;  p++) {
	  if (p && (inheap(*p)))

@s]


****Change:(orig (548 548 c))
@s[		mark_object(*p);
	}


@s|		mark_object(*p);
	}
	*/

@s]


****Change:(orig (574 574 a))
@s[	for (pp = pack_pointer;  pp != NULL;  pp = pp->p_link)
		mark_object(pp);

@s|	for (pp = pack_pointer;  pp != NULL;  pp = pp->p_link)
		mark_object(pp);
#ifdef KCLOVM
	if (ovm_process_created)
	  mark_all_stacks();
#endif

@s]


****Change:(orig (587 587 c))
@s[		for (pp = pack_pointer;  pp != NULL;  pp = pp->p_link) {

@s|
	{int size;
	 
	 for (pp = pack_pointer;  pp != NULL;  pp = pp->p_link) {
	                size = pp->p_internal_size;

@s]


****Change:(orig (589 589 c))
@s[				for (i = 0;  i < PHTABSIZE;  i++)

@s|				for (i = 0;  i < size;  i++)

@s]


****Change:(orig (590 590 a))
@s[					mark_object(pp->p_internal[i]);

@s|					mark_object(pp->p_internal[i]);
			size = pp->p_external_size;

@s]


****Change:(orig (592 592 c))
@s[				for (i = 0;  i < PHTABSIZE;  i++)

@s|				for (i = 0;  i < size;  i++)

@s]


****Change:(orig (594 597 c))
@s[		}
/*
	The following code is now in the comment.
	Interned symbols are never collocted.

@s|		}}

@s]


****Change:(orig (599 600 c))
@s[
		return;
	}

@s|
   /* mark the c stack */
#ifndef N_RECURSION_REQD
#define N_RECURSION_REQD 2
#endif		
	mark_c_stack(0,N_RECURSION_REQD,mark_stack_carefully);

@s]


****Change:(orig (602 622 c))
@s[	for (pp = pack_pointer;  pp != NULL;  pp = pp->p_link) {
	    if (pp->p_internal != NULL)
		for (i = 0;  i < PHTABSIZE;  i++)
		    for (l=pp->p_internal[i]; !endp(l); l=l->c.c_cdr) {

@s,		    mark_object(pp->p_external[i]);
	}

@s|}

@s]


****Change:(orig (624 636 c))
@s[	for (pp = pack_pointer;  pp != NULL;  pp = pp->p_link)
	    if (pp->p_internal != NULL)
		for (i = 0;  i < PHTABSIZE;  i++)
		    for (lp = &(pp->p_internal[i]);  !endp(*lp);) {

@s,			    lp = &((*lp)->c.c_cdr);
			}
		    }
*/

@s|mark_c_stack(env1,n,fn)
     jmp_buf *env1;
     int n;
     int (*fn)();
{jmp_buf env;
 int where;
 if (n > 0 )
   {  setjmp(env);
      mark_c_stack(env,n - 1,fn);}
 else
   {
	 
     /* If the locals of type object in a C function could be
	aligned other than on multiples of sizeof (char *)
	then define this.  At the moment 2 is the only other
	legitimate value besides 0 */
	 
#ifndef C_GC_OFFSET
#define C_GC_OFFSET 0
#endif
     if (&where > cs_org)
      (*fn)(0,cs_org,C_GC_OFFSET);
     else
       (*fn)(cs_org,0,C_GC_OFFSET);}


@s]


****Change:(orig (638 638 a))
@s[}


@s|}

 



@s]


****Change:(orig (692 692 a))
@s[				x->d.m = FALSE;
				continue;
			}

@s|				x->d.m = FALSE;
				continue;
			}
			/*   Since we now mark forwards and backwards on displaced
			     arrays, this is not necessary.

@s]


****Change:(orig (699 699 c))
@s[				if (x->a.a_displaced->c.c_car != Cnil)
					undisplace(x);

@s|				if (x->a.a_displaced->c.c_car != Cnil)
				  {undisplace(x);
				 }

@s]


****Change:(orig (700 700 a))
@s[			}

@s|			}
			*/

@s]


****Change:(orig (708 708 d))
@s[		tm->tm_nfree += k;
		tm->tm_nused -= k;

@s|		tm->tm_nfree += k;

@s]


****Change:(orig (775 775 a))
@s[	struct apage *pp, *qq;

@s|	struct apage *pp, *qq;
	int in_sgc = sgc_enabled;

@s]


****Change:(orig (781 785 d))
@s[	if (siVnotify_gbc->s.s_dbind != Cnil) {
		fprintf(stdout, "\nGBC invoked");
		fflush(stdout);
	}

@s,

@s|
@s]


****Change:(orig (790 790 c))
@s[		error("GBC is not enabled");

@s|             error("GBC is not enabled");

@s]


****Change:(orig (794 794 c))
@s[	if (saving_system)
		t = t_contiguous;

@s|	if (saving_system)
		{t = t_contiguous; gc_time = -1;
		 if(sgc_enabled) sgc_quit();

@s]


****Change:(orig (795 795 a))
@s[

@s|
	       }



@s]


****Change:(orig (810 818 c))
@s[	if (debug) {
		if (t == t_contiguous)
		    printf("GBC entered for collecting contiguous blocks\n");
		else if (t == t_relocatable)

@s, 			   tm_table[(int)t].tm_name);
		fflush(stdout);

@s|	if (debug || (siVnotify_gbc->s.s_dbind != Cnil)) {

	  if (gc_time < 0) gc_time=0;
	  printf("[%s for %d %s pages..",
		 (sgc_enabled ? "SGC" : "GC"),
		 (sgc_enabled ? sgc_count_type(t) : tm_of(t)->tm_npage),
		 (tm_table[(int)t].tm_name)+1);
#ifdef SGC
	  if(sgc_enabled)
	    printf("(%d writable)..",sgc_count_writable(page(core_end)));
#endif	  
	  fflush(stdout);

@s]


****Change:(orig (820 820 a))
@s[	}
#endif

@s|	}
#endif
        if (gc_time >=0) {gc_start=runtime();}

@s]


****Change:(orig (825 825 c))
@s[	if ((int)t >= (int)t_contiguous) {
		j = maxpage*16;

@s|	if ((int)t >= (int)t_contiguous) {
		j = maxpage*(PAGESIZE/(sizeof(int)*sizeof(int)*CHAR_SIZE)) ;

@s]


****Change:(orig (826 826 a))
@s[		/*

@s|		/*
		    (PAGESIZE / sizeof(int)) = x * (sizeof(int)*CHAR_SIZE)
		    eg if PAGESIZE = 2048  x=16

@s]


****Change:(orig (833 834 c))
@s[
		if (holepage < new_holepage)

@s|	       /* if in sgc we don't need more pages below hole
		  just more relocatable or cleaning it */
		if (sgc_enabled ==0 && holepage < new_holepage)

@s]


****Change:(orig (852 852 c))
@s[			rb_start = heap_end + PAGESIZE*holepage;

@s|		  if (sgc_enabled==0)
		    {rb_start = heap_end + PAGESIZE*holepage;}

@s]


****Change:(orig (854 854 c))
@s[		rb_end = rb_start + PAGESIZE*nrbpage;

@s|		rb_end = heap_end + (holepage + nrbpage) *PAGESIZE;

@s]


****Change:(orig (883 883 a))
@s[		tm = runtime();
	}
#endif

@s|		tm = runtime();
	}
#endif
#ifdef SGC
	if(sgc_enabled)
	  { if (t < t_end && tm_of(t)->tm_sgc == 0)
	      {sgc_quit();
	       	if (siVnotify_gbc->s.s_dbind != Cnil)
		  {fprintf(stdout, " (doing full gc)");
		   fflush(stdout);}
	       mark_phase();}
	    else
	  sgc_mark_phase();}
	else
#endif	

@s]


****Change:(orig (898 898 a))
@s[		tm = runtime();
	}
#endif

@s|		tm = runtime();
	}
#endif
#ifdef SGC
	if(sgc_enabled)
	  sgc_sweep_phase();
	else
#endif	

@s]


****Change:(orig (915 915 c))
@s[		contblock_sweep_phase();

@s|
#ifdef SGC
	if (sgc_enabled)
	  sgc_contblock_sweep_phase();
	else
#endif
	  contblock_sweep_phase();

@s]


****Change:(orig (932 932 a))
@s[				*pp++ = *qq++;
		}


@s|				*pp++ = *qq++;
		}

#ifdef SGC
		/* we don't know which pages have relblock on them */
		 if(sgc_enabled)
                  make_writable(page(rb_start),
                                (rb_pointer-rb_start + PAGESIZE - 1)/PAGESIZE);

#endif		

@s]


****Change:(orig (943 943 c))
@s[				       tm_table[i].tm_nused,

@s|				       TM_NUSED(tm_table[i]),

@s]


****Change:(orig (975 975 a))
@s[		maxcbpage -= ncbpage;

@s|		maxcbpage -= ncbpage;
		if (maxcbpage < 100)
		  maxcbpage = 100;

@s]


****Change:(orig (979 979 c))
@s[		holepage = new_holepage;

@s|		if (sgc_enabled==0) holepage = new_holepage;

@s]


****Change:(orig (982 982 c))
@s[		nrbpage -= j;
		if (nrbpage <= 0)

@s|		nrbpage -= j;
		if (nrbpage < 0)

@s]


****Change:(orig (993 993 a))
@s[	if (GBC_exit_hook != NULL)
		(*GBC_exit_hook)();


@s|	if (GBC_exit_hook != NULL)
		(*GBC_exit_hook)();


	if (in_sgc && sgc_enabled==0)
	  sgc_start();

        if(gc_time>=0) {gc_time=gc_time+(gc_start=(runtime()-gc_start));}


@s]


****Change:(orig (995 995 c))
@s[		fprintf(stdout, "\nGBC finished\n");

@s|
	  fprintf(stdout, "(T=%d).GC finished]\n",
		  gc_start
		  );

@s]


****Change:(orig (997 997 a))
@s[		fflush(stdout);
	}

@s|		fflush(stdout);
	}


	CHECK_FOR_INTERRUPT;

@s]


****Change:(orig (1023 1023 c))
@s[			vs_check_push(make_fixnum(tm_table[i].tm_nused));

@s|			vs_check_push(make_fixnum(TM_NUSED(tm_table[i])));

@s]


****Change:(orig (1048 1048 a))
@s[		tm_table[i].tm_gbccount = 0;
}


@s|		tm_table[i].tm_gbccount = 0;
}

/* copy S bytes starting at P to beyond rb_pointer1 (temporarily)
 but return a pointer to where this will be copied back to,
 when gc is done.  alignment of rb_pointer is kept at a multiple
 of sizeof(char *);
 */
      

@s]


****Change:(orig (1053 1054 c))
@s[int s;
{
	STATIC char *q, *e;

@s|int s;
{ char *res = rb_pointer;
  char *q = rb_pointer1;
  s = round_up(s);
  rb_pointer += s;
  rb_pointer1 += s;
  
  while (--s >= 0)
    { *q++ = *p++;}

@s]


****Change:(orig (1056 1064 c))
@s[	s = round_up(s);
	e = p + s;
	q = rb_pointer1;
	while (p < e)

@s,	rb_pointer1 += s;
	return(q);

@s|  return res;

@s]


****Change:(orig (1066 1066 a))
@s[}


@s|}

  

@s]


****Change:(orig (1074 1074 c))
@s[	if ((enum type)type_map[page(p)] != t_contiguous)

@s|	if (!MAYBE_DATA_P(p) || (enum type)type_map[page(p)] != t_contiguous)

@s]


****Change:(orig (1094 1094 a))
@s[		GBC(t_relocatable);
}


@s|		GBC(t_relocatable);
}

siLgbc_time()
{if (vs_top>vs_base)
   gc_time=fix(vs_base[0]);
 else
   {vs_base[0]=make_fixnum(gc_time);
    vs_top=vs_base+1;}
}

#ifdef SGC
#include "sgbc.c"
#endif


@s]


****Change:(orig (1098 1098 a))
@s[	make_si_function("RESET-GBC-COUNT", siLreset_gbc_count);

@s|	make_si_function("RESET-GBC-COUNT", siLreset_gbc_count);
	make_si_function("GBC-TIME",siLgbc_time);

@s]


****Change:(orig (1106 1106 a))
@s[	make_function("GBC", Lgbc);

@s|	make_function("GBC", Lgbc);
#ifdef SGC
	/* we use that maxpage is a power of 2 in this
	   case, to quickly be able to look in our table */ 
	{int i ;
	 for(i=1 ; i< 32 ; i++)
	   {if (MAXPAGE == (1 <<i))
	      goto ok;}
	 perror("MAXPAGE is not a power of 2.  Recompile");
	 exit(1);
       ok:;}
	make_si_function("SGC-ON",siLsgc_on);
#endif	

@s]


****Change:(orig (1107 1107 a))
@s[}

@s|}


@s]

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.