diff -ruN klic-3.003-2002-02-19/include/klic/struct.h klic-3.003-2002-02-19a/include/klic/struct.h
--- klic-3.003-2002-02-19/include/klic/struct.h	Sat Feb 16 12:09:23 2002
+++ klic-3.003-2002-02-19a/include/klic/struct.h	Tue Feb 19 13:48:35 2002
@@ -238,10 +238,6 @@
 #define real_heapbytesize (glbl->real_heapbytesize0)
 #define incrementsize	(glbl->incrementsize0)
 #define maxactiveratio	(glbl->maxactiveratio0)
-#define new_space_top	(glbl->new_space_top0)
-#define old_space_top	(glbl->old_space_top0)
-#define new_space_size	(glbl->new_space_size0)
-#define old_space_size	(glbl->old_space_size0)
 #define this_more_space	(glbl->this_more_space0)
 #define gcstack		(glbl->gcstack0)
 #define gcsp		(glbl->gcsp0)
@@ -291,9 +287,6 @@
   unsigned long real_heapbytesize0;
   double maxactiveratio0;
   unsigned long this_more_space0; /* at least this # of words needed after GC */
-  q* new_space_top0;
-  q* old_space_top0;
-  unsigned long new_space_size0, old_space_size0;
   q** gcstack0;
   q** gcsp0;
   q** gcmax0;
@@ -362,6 +355,14 @@
 
 /* runtime/alloc.c */
 extern q* heapp(void);
+extern q* new_space_top(void);
+extern q* old_space_top(void);
+extern unsigned long new_space_size(void);
+extern unsigned long old_space_size(void);
 extern void set_heapp(q* p);
+extern void set_new_space_top(q* p);
+extern void set_old_space_top(q* p);
+extern void set_new_space_size(unsigned long size);
+extern void set_old_space_size(unsigned long size);
 
 #endif /* _KLIC_STRUCT_H_ */
diff -ruN klic-3.003-2002-02-19/runtime/alloc.c klic-3.003-2002-02-19a/runtime/alloc.c
--- klic-3.003-2002-02-19/runtime/alloc.c	Mon Feb 18 17:10:03 2002
+++ klic-3.003-2002-02-19a/runtime/alloc.c	Tue Feb 19 13:54:53 2002
@@ -11,6 +11,9 @@
 #include <klic/primitives.h>  /* extern */
 
 static q* heapp0;  /* top of free area (when decached) */
+static q* new_space_top0;
+static q* old_space_top0;
+static unsigned long new_space_size0, old_space_size0;
 
 extern q*
 heapp(void)
@@ -24,6 +27,15 @@
   heapp0 = p;
 }
 
+extern q* new_space_top(void){ return new_space_top0; }
+extern q* old_space_top(void){ return old_space_top0; }
+extern unsigned long new_space_size(void){ return new_space_size0; }
+extern unsigned long old_space_size(void){ return old_space_size0; }
+extern void set_new_space_top(q* p){ new_space_top0 = p; }
+extern void set_old_space_top(q* p){ old_space_top0 = p; }
+extern void set_new_space_size(unsigned long size){ new_space_size0 = size; }
+extern void set_old_space_size(unsigned long size){ old_space_size0 = size; }
+
 extern void*
 malloc_check(size)
      unsigned long size;
@@ -53,9 +65,9 @@
 reinit_alloc()
 {
   declare_globals;
-  heaplimit = real_heaplimit = new_space_top+heapsize;
+  heaplimit = real_heaplimit = new_space_top() + heapsize;
   heapbottom = real_heaplimit+incrementsize;
-  set_heapp( heaptop = new_space_top );
+  set_heapp( heaptop = new_space_top() );
   real_heapbytesize = (unsigned long) heapbottom - (unsigned long) heaptop;
   this_more_space = 0;
   gc_hooktab_size = 32;
@@ -79,9 +91,10 @@
     fatalf("Invalid memory size specification: heap = %d, incremental = %d",
 	    heapsize, incrementsize);
   }
-  old_space_size = new_space_size = bytesize;
-  new_space_top = (q*) malloc_check(bytesize);
-  old_space_top = (q*) malloc_check(bytesize);
+  set_new_space_size(bytesize);
+  set_old_space_size(bytesize);
+  set_new_space_top((q*) malloc_check(bytesize));
+  set_old_space_top((q*) malloc_check(bytesize));
   reinit_alloc();
 }
 
diff -ruN klic-3.003-2002-02-19/runtime/gc.c klic-3.003-2002-02-19a/runtime/gc.c
--- klic-3.003-2002-02-19/runtime/gc.c	Tue Feb 19 13:12:04 2002
+++ klic-3.003-2002-02-19a/runtime/gc.c	Tue Feb 19 13:58:48 2002
@@ -50,12 +50,12 @@
 flip_spaces()
 {
   declare_globals;
-  q* tempp = new_space_top;
-  unsigned long temps = new_space_size;
-  new_space_top = old_space_top;
-  new_space_size = old_space_size;
-  old_space_top = tempp;
-  old_space_size = temps;
+  q* tempp = new_space_top();
+  unsigned long temps = new_space_size();
+  set_new_space_top(old_space_top());
+  set_new_space_size(old_space_size());
+  set_old_space_top(tempp);
+  set_old_space_size(temps);
 }
 
 extern struct goalrec*
@@ -82,8 +82,8 @@
       new_new_space_top = (q*) malloc(bytesize);
       if( new_new_space_top != NULL ){
 	free(old_space_top);
-	old_space_top = new_old_space_top;
-	old_space_size = bytesize;
+	set_old_space_top(new_old_space_top);
+	set_old_space_size(bytesize);
       }else{
 	free(new_old_space_top);
 	if( lastgc_dangerous ){
@@ -100,11 +100,11 @@
   qp = collect_garbage(qp);
   if( make_heap_larger ){
     free(old_space_top);
-    old_space_top = new_new_space_top;
-    old_space_size = bytesize;
+    set_old_space_top(new_new_space_top);
+    set_old_space_size(bytesize);
   }
   make_heap_larger =
-    (heapp()-new_space_top+this_more_space > heapsize*maxactiveratio &&
+    (heapp()-new_space_top()+this_more_space > heapsize*maxactiveratio &&
      heapsize < maxheapsize);
   lastgc_dangerous = (real_heaplimit < heapp()+this_more_space);
   if( lastgc_dangerous ){
@@ -571,10 +571,10 @@
   }
 #endif /* SHM */
 
-  allocp = ntop = heaptop = new_space_top;
-  otop = old_space_top;
-  real_heapbytesize = nsize = new_space_size;
-  osize = old_space_size;
+  allocp = ntop = heaptop = new_space_top();
+  otop = old_space_top();
+  real_heapbytesize = nsize = new_space_size();
+  osize = old_space_size();
   real_heaplimit = allocp+heapsize;
   heaplimit = (interrupt_off ? real_heaplimit : 0);
   heapbottom = real_heaplimit + incrementsize;
@@ -780,11 +780,9 @@
   q** sp;
 {
   declare_globals;
-  q* allocp = heapp();
 
   push_gc_stack(term, sp, gcmax);
-  set_heapp(allocp);
-  copy_terms(new_space_top, old_space_top, new_space_size, old_space_size,
+  copy_terms(new_space_top(), old_space_top(), new_space_size(), old_space_size(),
 	     sp, gcmax);
   return *term;
 }
diff -ruN klic-3.003-2002-02-19/runtime/print.c klic-3.003-2002-02-19a/runtime/print.c
--- klic-3.003-2002-02-19/runtime/print.c	Mon Feb 18 16:09:56 2002
+++ klic-3.003-2002-02-19a/runtime/print.c	Tue Feb 19 13:59:00 2002
@@ -46,7 +46,7 @@
   }
 
  var:
-  klic_fprintf(stream, "_%X", (q*)x-new_space_top);
+  klic_fprintf(stream, "_%X", (q*)x-new_space_top());
 #ifdef DEBUGLIB
   if( verbose_print ){
     if( derefone(x) != x ){
diff -ruN klic-3.003-2002-02-19/runtime/random.c klic-3.003-2002-02-19a/runtime/random.c
--- klic-3.003-2002-02-19/runtime/random.c	Sat Feb 16 12:02:21 2002
+++ klic-3.003-2002-02-19a/runtime/random.c	Tue Feb 19 13:59:14 2002
@@ -67,7 +67,7 @@
 GGDEF_PRINT()
 {
   G_STD_DECL;
-  fprintf(g_fp, "RANDOM@%X", (q*)GG_SELF-new_space_top);
+  fprintf(g_fp, "RANDOM@%X", (q*)GG_SELF-new_space_top());
   return 0;
 }
 
diff -ruN klic-3.003-2002-02-19/runtime/sysc.kl1 klic-3.003-2002-02-19a/runtime/sysc.kl1
--- klic-3.003-2002-02-19/runtime/sysc.kl1	Sat Dec 29 12:46:20 2001
+++ klic-3.003-2002-02-19a/runtime/sysc.kl1	Tue Feb 19 13:59:41 2002
@@ -42,7 +42,7 @@
 
 gc(Before,After) :- inline:"
 {
-  %0 = makeint(allocp-new_space_top);
+  %0 = makeint(allocp-new_space_top());
   allocp = real_heaplimit;
   heaplimit = 0;
 }":[Before0-int] |
@@ -51,6 +51,6 @@
 
 after_gc(After) :- inline:"
 {
-  %0 = makeint(allocp-new_space_top);
+  %0 = makeint(allocp-new_space_top());
 }":[After0-int] |
     After=After0.
diff -ruN klic-3.003-2002-02-19/runtime/var.kl1 klic-3.003-2002-02-19a/runtime/var.kl1
--- klic-3.003-2002-02-19/runtime/var.kl1	Thu Dec 27 19:15:57 2001
+++ klic-3.003-2002-02-19a/runtime/var.kl1	Tue Feb 19 13:59:54 2002
@@ -104,7 +104,7 @@
   }
   goto %f;
  really_unbound:
-  %1 = makeint((q*)tmp-new_space_top);
+  %1 = makeint((q*)tmp-new_space_top());
 }":[X+any,Addr-int] |
     Result={0,Addr,X}.
 otherwise.
