diff -ruN klic-3.003-2002-02-19a/runtime/gc.c klic-3.003-2002-02-19b/runtime/gc.c
--- klic-3.003-2002-02-19a/runtime/gc.c	Tue Feb 19 13:58:48 2002
+++ klic-3.003-2002-02-19b/runtime/gc.c	Tue Feb 19 14:27:18 2002
@@ -160,10 +160,10 @@
 #endif /* SHM */
 
 #define within_new_space(x)	\
-  ((unsigned long)(x) - (unsigned long)ntop < nsize)
+  ((unsigned long)(x) - (unsigned long)new_space_top() < new_space_size())
 
 #define within_old_space(x)	\
-  ((unsigned long)(x) - (unsigned long)otop < osize)
+  ((unsigned long)(x) - (unsigned long)old_space_top() < old_space_size())
 
 #define push_gc_stack(addr, sp, max)			\
 do{							\
@@ -220,10 +220,7 @@
 }while(0)
 
 static void
-copy_terms(ntop, otop, nsize, osize, sp, max)
-  q* ntop;
-  q* otop;
-  unsigned long nsize, osize;
+copy_terms(sp, max)
   q** sp;
   q** max;
 {
@@ -457,11 +454,8 @@
 }
 
 static struct goalrec*
-copy_one_queue(qp, ntop, otop, nsize, osize)
+copy_one_queue(qp)
   struct goalrec* qp;
-  q* ntop;
-  q* otop;
-  unsigned long nsize, osize;
 {
   declare_globals;
   struct goalrec* last;
@@ -493,7 +487,7 @@
     hp = heapp();
     copy_one_goal(qp, gcsp, gcmax, 0);
     set_heapp(hp);
-    copy_terms(ntop, otop, nsize, osize, gcsp, gcmax);
+    copy_terms(gcsp, gcmax);
     qp->next = last;
     last = qp;
   }
@@ -585,9 +579,9 @@
 
   set_heapp(allocp);
   for( ; pq->prio >= 0; pq = pq->next ){
-    pq->q = copy_one_queue(pq->q, ntop, otop, nsize, osize);
+    pq->q = copy_one_queue(pq->q);
   }
-  qp = copy_one_queue(qp, ntop, otop, nsize, osize);
+  qp = copy_one_queue(qp);
 
 #ifdef SHM
   {
@@ -599,7 +593,7 @@
       case CONS:
       case FUNCTOR:  /* generator hook but anybody reqested */
         push_gc_stack((q*) &sptr->localA, gcsp, gcmax);
-	copy_terms(ntop, otop, nsize, osize, gcsp, gcmax);
+	copy_terms(gcsp, gcmax);
         push_shm_stack(&sptr->globalA, shm_sp, shm_gcmax);
         break;
       case ATOMIC: /* genarator object (distributed interface) */
@@ -616,7 +610,7 @@
 
 	    /* patch for debugging of hirata problem */
 	    hirata_bug1 = 1;
-	    copy_terms(ntop, otop, nsize, osize, gcsp, gcmax);
+	    copy_terms(gcsp, gcmax);
 	    hirata_bug1 = 0;
 
 	    wk = derefone(top);
@@ -626,7 +620,7 @@
 	    derefone(wk) = 0;
 	  }else{ /* generator */
 	    push_gc_stack(&wk, gcsp, gcmax);
-	    copy_terms(ntop, otop, nsize, osize, gcsp, gcmax);
+	    copy_terms(gcsp, gcmax);
 	    sptr->localA = (q*) tag_local(wk);
 	  }
 	  push_shm_stack(&sptr->globalA, shm_sp, shm_gcmax);
@@ -641,7 +635,7 @@
 	  }else if( isint(wqp->next) ){
 	    copy_one_goal(wqp, gcsp, gcmax, 1);
 	    sptr->localA = (q*) wqp;
-	    copy_terms(ntop, otop, nsize, osize, gcsp, gcmax);
+	    copy_terms(gcsp, gcmax);
 	    if( isref(sptr->globalA) ){
 	      for(;;){
 		q ww = derefone(sptr->globalA);
@@ -725,7 +719,7 @@
 	/* not copied yet */
 	copy_one_goal(sgl->goal, gcsp, gcmax, 0);
 	set_heapp(hp);
-	copy_terms(ntop, otop, nsize, osize, gcsp, gcmax);
+	copy_terms(gcsp, gcmax);
 	hp = heapp();
 	dead_goal = sgl->goal;
       }
@@ -767,7 +761,7 @@
   declare_globals;
   push_gc_stack(term, gcsp, gcmax);
   set_heapp(allocp);
-  copy_terms(ntop, otop, nsize, osize, gcsp, gcmax);
+  copy_terms(gcsp, gcmax);
   return heapp();
 }
 
@@ -782,7 +776,6 @@
   declare_globals;
 
   push_gc_stack(term, sp, gcmax);
-  copy_terms(new_space_top(), old_space_top(), new_space_size(), old_space_size(),
-	     sp, gcmax);
+  copy_terms(sp, gcmax);
   return *term;
 }
