diff -ruN klic-3.003-2002-03-08b/include/klic/g_methtab.h klic-3.003-2002-03-09/include/klic/g_methtab.h --- klic-3.003-2002-03-08b/include/klic/g_methtab.h Tue Mar 5 21:28:43 2002 +++ klic-3.003-2002-03-09/include/klic/g_methtab.h Sat Mar 9 12:02:52 2002 @@ -23,9 +23,8 @@ struct data_object_method_table { q (*passive_unify)( /* struct data_object *one, struct data_object *another */ ); - q *(*active_unify)( /* struct data_object *one, - with method_result struct data_object *another, - q * allocp */ ); + void (*active_unify)( /* struct data_object* one, + with method_result struct data_object* another */ ); long (*print)( /* struct iimutable_object * obj, FILE *out_stream, unsigned long depth, @@ -59,9 +58,8 @@ }; struct consumer_object_method_table { - q *(*active_unify)(/* struct consumer_object *self, - with method_result q other, - q *allocp */ ); + void (*active_unify)(/* struct consumer_object* self, + with method_result q other */ ); long (*print)(/* struct consumer_object *obj, FILE *out_stream, unsigned long max_depth, @@ -80,9 +78,7 @@ }; struct generator_object_method_table { - q* (*active_unify)(/* q self, - q other, - q* allocp */); + void (*active_unify)(/* q self, q other */); q (*generate)(/* struct generator_object* self, q* allocp */); q (*suspend)(/* q reference, struct goalrec* goal */); diff -ruN klic-3.003-2002-03-08b/include/klic/gc_macro.h klic-3.003-2002-03-09/include/klic/gc_macro.h --- klic-3.003-2002-03-08b/include/klic/gc_macro.h Tue Mar 5 21:54:59 2002 +++ klic-3.003-2002-03-09/include/klic/gc_macro.h Sat Mar 9 13:00:49 2002 @@ -46,14 +46,16 @@ do{ \ set_method_result(GC_SUCCEEDED); \ set_rest_of_stream(x); \ - return g_allocp; \ + set_heapp(g_allocp); \ + return; \ }while(0) #define GC_TERMINATE \ do{ \ set_method_result(GC_SUCCEEDED); \ set_rest_of_stream(NULL); \ - return g_allocp; \ + set_heapp(g_allocp); \ + return; \ }while(0) #define GC_SUSPEND(var) \ @@ -199,11 +201,7 @@ /**********************************************************************/ #define GCDEF_UNIFY() \ - static q * \ - GC_rappend(active_unify) (GC_SELF,GC_TERM,g_allocp) \ - GC_OBJ_TYPE *GC_SELF; \ - q GC_TERM; \ - q *g_allocp; +static void GC_rappend(active_unify) (GC_OBJ_TYPE* GC_SELF, q GC_TERM) #define GC_PRINT(x) klic_fprintf(g_fp, (x)) diff -ruN klic-3.003-2002-03-08b/include/klic/gd_macro.h klic-3.003-2002-03-09/include/klic/gd_macro.h --- klic-3.003-2002-03-08b/include/klic/gd_macro.h Tue Mar 5 22:04:40 2002 +++ klic-3.003-2002-03-09/include/klic/gd_macro.h Sat Mar 9 12:03:10 2002 @@ -320,11 +320,8 @@ GD_OBJ_TYPE * GD_OTHER; #define GDDEF_UNIFY() \ - static q *\ - GD_rappend(active_unify) (GD_SELF,GD_OTHER,g_allocp) \ - GD_OBJ_TYPE * GD_SELF; \ - GD_OBJ_TYPE * GD_OTHER; \ - q *g_allocp; +static void \ +GD_rappend(active_unify) (GD_OBJ_TYPE* GD_SELF, GD_OBJ_TYPE* GD_OTHER) #define GD_PUTC(x) klic_putc((x), g_fp) diff -ruN klic-3.003-2002-03-08b/include/klic/gg_macro.h klic-3.003-2002-03-09/include/klic/gg_macro.h --- klic-3.003-2002-03-08b/include/klic/gg_macro.h Tue Mar 5 21:57:42 2002 +++ klic-3.003-2002-03-09/include/klic/gg_macro.h Sat Mar 9 13:01:28 2002 @@ -41,7 +41,7 @@ #define GG_GCREQUEST GENERIC_GCREQUEST #define GG_RETURN do{ return g_allocp; }while(0) -#define GG_TERMINATE do{ return g_allocp; }while(0) +#define GG_TERMINATE do{ set_heapp(g_allocp); return; }while(0) #define GG_SUSPEND(var) \ do{ \ @@ -178,11 +178,7 @@ /**********************************************************************/ #define GGDEF_UNIFY() \ -static q* \ - GG_rappend(active_unify) (GG_SELF, GG_TERM, g_allocp) \ - q GG_SELF; \ - q GG_TERM; \ - q *g_allocp; +static void GG_rappend(active_unify) (q GG_SELF, q GG_TERM) #define GGDEF_SUSPEND() \ static q \ diff -ruN klic-3.003-2002-03-08b/runtime/faisus.c klic-3.003-2002-03-09/runtime/faisus.c --- klic-3.003-2002-03-08b/runtime/faisus.c Fri Mar 8 20:10:33 2002 +++ klic-3.003-2002-03-09/runtime/faisus.c Sat Mar 9 11:41:27 2002 @@ -111,7 +111,7 @@ struct generator_susp* gsusp = generator_suspp(susp); q ref = gsusp->backpt; struct generator_object* gobj = untag_generator_susp(gsusp->u.o); - q tmp = generic_generate(gobj, heapp()); + q tmp = generic_generate(gobj); if (tmp != (q)0) { if ( tmp == makecons(0) ) { q retval = generic_suspend(gobj, ref, goal); @@ -242,7 +242,7 @@ struct generator_susp* gsusp = generator_suspp(susp); q ref = gsusp->backpt; struct generator_object* gobj = untag_generator_susp(gsusp->u.o); - q tmp = generic_generate(gobj, heapp()); + q tmp = generic_generate(gobj); if(tmp == makecons(0)) { q retval = generic_suspend(gobj, ref, goal); @@ -299,7 +299,7 @@ if (is_generator_susp(susp->u)) { struct generator_susp* gsusp = generator_suspp(susp); q ref = gsusp->backpt; - q tmp = generic_generate(untag_generator_susp(gsusp->u.o), heapp()); + q tmp = generic_generate(untag_generator_susp(gsusp->u.o)); if (tmp == 0) goto fin; derefone(ref) = tmp; value = tmp; diff -ruN klic-3.003-2002-03-08b/runtime/gcode.c klic-3.003-2002-03-09/runtime/gcode.c --- klic-3.003-2002-03-08b/runtime/gcode.c Tue Mar 5 22:08:48 2002 +++ klic-3.003-2002-03-09/runtime/gcode.c Sat Mar 9 12:16:17 2002 @@ -49,8 +49,6 @@ if( GD_SELF->method_table != GD_OTHER->method_table || GD_SELF->pdesc != GD_OTHER->pdesc ) GD_UNIFY_FAIL; - else - GD_RETURN; } GDDEF_GC() diff -ruN klic-3.003-2002-03-08b/runtime/ge_exref.c klic-3.003-2002-03-09/runtime/ge_exref.c --- klic-3.003-2002-03-08b/runtime/ge_exref.c Tue Mar 5 22:09:56 2002 +++ klic-3.003-2002-03-09/runtime/ge_exref.c Sat Mar 9 13:03:21 2002 @@ -65,6 +65,7 @@ GGDEF_UNIFY() { G_STD_DECL; + q* g_allocp = heapp(); struct generator_susp* gsusp = generator_suspp(derefone(GG_SELF)); struct exref_object* GG_OBJ = (struct exref_object*) untag_generator_susp(gsusp->u.o); @@ -104,7 +105,7 @@ /* fprintf(stderr, "Node:%d unify EXREF-non-EXREF", my_node); */ } } - return NULL; /* Cannot unify now */ + set_heapp(NULL); /* Cannot unify now */ } GGDEF_ENCODE() diff -ruN klic-3.003-2002-03-08b/runtime/ge_readhook.c klic-3.003-2002-03-09/runtime/ge_readhook.c --- klic-3.003-2002-03-08b/runtime/ge_readhook.c Tue Mar 5 22:10:43 2002 +++ klic-3.003-2002-03-09/runtime/ge_readhook.c Sat Mar 9 13:07:34 2002 @@ -31,6 +31,7 @@ GCDEF_UNIFY() { G_STD_DECL; + q* g_allocp = heapp(); GC_SWITCH_ON_TERM(list0, atomic0, functor0, generic_data0, susp0); diff -ruN klic-3.003-2002-03-08b/runtime/ge_replyhook.c klic-3.003-2002-03-09/runtime/ge_replyhook.c --- klic-3.003-2002-03-08b/runtime/ge_replyhook.c Tue Mar 5 22:22:46 2002 +++ klic-3.003-2002-03-09/runtime/ge_replyhook.c Sat Mar 9 13:07:52 2002 @@ -26,6 +26,7 @@ GCDEF_UNIFY() { G_STD_DECL; + q* g_allocp = heapp(); /* INT_CL_DEBUG_X(printf("replyhook active unify\n")); */ diff -ruN klic-3.003-2002-03-08b/runtime/gfloat.c klic-3.003-2002-03-09/runtime/gfloat.c --- klic-3.003-2002-03-08b/runtime/gfloat.c Tue Mar 5 22:29:09 2002 +++ klic-3.003-2002-03-09/runtime/gfloat.c Sat Mar 9 12:29:32 2002 @@ -103,7 +103,6 @@ if( GD_SELF->method_table != GD_OTHER->method_table || GD_SELF->value != GD_OTHER->value ) GD_UNIFY_FAIL; - GD_RETURN; } GDDEF_GC() diff -ruN klic-3.003-2002-03-08b/runtime/gg_shbusy.c klic-3.003-2002-03-09/runtime/gg_shbusy.c --- klic-3.003-2002-03-08b/runtime/gg_shbusy.c Fri Mar 8 20:10:33 2002 +++ klic-3.003-2002-03-09/runtime/gg_shbusy.c Sat Mar 9 12:33:13 2002 @@ -21,7 +21,7 @@ #define GG_CLASS_NAME() shbusy #define GG_OBJ_TYPE struct Shbusy -#define One_more() (set_heapp(g_allocp), do_unify(GG_SELF, GG_TERM), heapp()) +#define One_more() (set_heapp(g_allocp), do_unify(GG_SELF, GG_TERM)) struct Shbusy { struct generator_object_method_table *method_table; @@ -30,15 +30,16 @@ GGDEF_UNIFY() { G_STD_DECL; + q* g_allocp = heapp(); struct generator_object* gobj; q pair = derefone(GG_SELF); - if( !isref(pair) || GG_SELF != derefone(pair) ){ return One_more(); } + if( !isref(pair) || GG_SELF != derefone(pair) ){ One_more(); return; } gobj = n_lock(GG_SELF, pair); if( derefone(GG_SELF) == pair ){ n_unlock(pair, gobj); } - return One_more(); + One_more(); } GGDEF_GENERATE() diff -ruN klic-3.003-2002-03-08b/runtime/gg_shvar.c klic-3.003-2002-03-09/runtime/gg_shvar.c --- klic-3.003-2002-03-08b/runtime/gg_shvar.c Fri Mar 8 20:10:33 2002 +++ klic-3.003-2002-03-09/runtime/gg_shvar.c Sat Mar 9 13:22:44 2002 @@ -22,7 +22,7 @@ #define GG_CLASS_NAME() shvar #define GG_OBJ_TYPE struct Shvar -#define One_more() (set_heapp(g_allocp), do_unify(GG_SELF, GG_TERM), heapp()) +#define One_more() (set_heapp(g_allocp), do_unify(GG_SELF, GG_TERM)) struct Shvar { struct generator_object_method_table *method_table; @@ -58,13 +58,14 @@ GGDEF_UNIFY() { G_STD_DECL; + q* g_allocp = heapp(); struct generator_object *addi; Shvar *gobjp; q pair = derefone(GG_SELF); - if( !isref(pair) || GG_SELF != derefone(pair) ) return One_more(); + if( !isref(pair) || GG_SELF != derefone(pair) ){ One_more(); return; } addi = n_lock(GG_SELF, pair); - if( pair != derefone(GG_SELF) ) return One_more(); + if( pair != derefone(GG_SELF) ){ One_more(); return; } gobjp = (Shvar*) untag_generator_susp(addi); GG_SWITCH_ON_TERM(cons, atomic, func, dobj, susp); @@ -79,7 +80,7 @@ g_allocp = shm_resume_goals(g_allocp, gobjp->chain); } } - GG_RETURN; + GG_TERMINATE; } cons: @@ -91,7 +92,6 @@ && (!GENHOPT || last_shm_var == GG_SELF) ){ gobjp = create_genhook(GG_TERM, GG_SELF); n_unlock(pair, tag_generator_susp(gobjp)); - GG_RETURN; }else{ ck_new_galloc(GG_SELF); y = shm_copy(GG_TERM); @@ -105,7 +105,7 @@ } } } - GG_RETURN; + GG_TERMINATE; } susp: @@ -121,13 +121,10 @@ Re_try: ytemp = derefone(y); - if( !isref(ytemp) ){ + if( !isref(ytemp) || y != derefone(ytemp) ){ n_unlock(temp, xaddi); - return One_more(); - } - if( y != derefone(ytemp) ){ - n_unlock(temp, xaddi); - return One_more(); + One_more(); + return; } yaddi = generator_suspp(ytemp)->u.o; /* if yaddi is generator_susp */ @@ -138,7 +135,7 @@ if( m == SHM_VAR || m == SHM_BUSY ){ if( x == y ){ n_unlock(temp, xaddi); - GG_RETURN; + GG_TERMINATE; } if( cmp_forward_ptr(x,y) ){ /* reverse order */ q w; @@ -147,7 +144,8 @@ w = temp; temp = ytemp; ytemp = w; xaddi = n_lock(x, temp); if( temp != derefone(x) ){ - return One_more(); + One_more(); + return; } xobjp = (Shvar*) untag_generator_susp(xaddi); } @@ -160,7 +158,8 @@ yaddi = n_lock(y, ytemp); if( derefone(y) != ytemp ){ n_unlock(temp,xaddi); - return One_more(); + One_more(); + return; } yobjp = (Shvar*) untag_generator_susp(yaddi); if( yobjp->chain ){ @@ -199,17 +198,20 @@ /* assumes user defined object. Not Exref */ if( xobjp->chain ){ /* x has any info */ struct generator_object* gobjy = untag_generator_susp(yaddi); - q tmpy = generic_generate(gobjy, g_allocp); + q tmpy; + set_heapp(g_allocp); + tmpy = generic_generate(gobjy); switch( (long)tmpy ){ case (long) makeref(0): GG_KL1_UNIFY(x, y); - GG_RETURN; + GG_TERMINATE; case (long) makecons(0): fatal("system bug!!!"); default: g_allocp = heapp(); derefone(y) = tmpy; - return One_more(); + One_more(); + return; } }else{ /* x is a simple variable */ xobjp = create_genhook(tag_local(y), x); @@ -226,7 +228,7 @@ n_unlock(temp, tag_generator_susp(tobj)); } } - GG_RETURN; + GG_TERMINATE; } } diff -ruN klic-3.003-2002-03-08b/runtime/gio.c klic-3.003-2002-03-09/runtime/gio.c --- klic-3.003-2002-03-08b/runtime/gio.c Tue Mar 5 22:14:53 2002 +++ klic-3.003-2002-03-09/runtime/gio.c Sat Mar 9 13:09:43 2002 @@ -73,6 +73,7 @@ GCDEF_UNIFY() { G_STD_DECL; + q* g_allocp = heapp(); q newvar; q reason; diff -ruN klic-3.003-2002-03-08b/runtime/gmerge.c klic-3.003-2002-03-09/runtime/gmerge.c --- klic-3.003-2002-03-08b/runtime/gmerge.c Tue Mar 5 22:15:17 2002 +++ klic-3.003-2002-03-09/runtime/gmerge.c Sat Mar 9 13:11:12 2002 @@ -47,6 +47,7 @@ GCDEF_UNIFY() { G_STD_DECL; + q* g_allocp = heapp(); q newvar; top: @@ -117,7 +118,7 @@ GC_RETURN_WITH_HOOK(newvar); } else goto invalid_data; susp0: - GC_RETURN_WITH_HOOK(GC_TERM); + GC_RETURN_WITH_HOOK(GC_TERM); invalid_data: debug_printf("### %k ###\n", GC_TERM); GC_FAIL("Invalid data unified with merger"); diff -ruN klic-3.003-2002-03-08b/runtime/gmodule.c klic-3.003-2002-03-09/runtime/gmodule.c --- klic-3.003-2002-03-08b/runtime/gmodule.c Tue Mar 5 22:21:35 2002 +++ klic-3.003-2002-03-09/runtime/gmodule.c Sat Mar 9 12:51:01 2002 @@ -52,7 +52,6 @@ if (GD_SELF->method_table != GD_OTHER->method_table || GD_SELF->name != GD_OTHER->name) GD_UNIFY_FAIL; - GD_RETURN; } GDDEF_GC() diff -ruN klic-3.003-2002-03-08b/runtime/gmvv.c klic-3.003-2002-03-09/runtime/gmvv.c --- klic-3.003-2002-03-08b/runtime/gmvv.c Tue Mar 5 22:17:19 2002 +++ klic-3.003-2002-03-09/runtime/gmvv.c Sat Mar 9 12:51:38 2002 @@ -116,6 +116,7 @@ GDDEF_UNIFY() { G_STD_DECL; + q* g_allocp = heapp(); long size, k; if (GD_SELF->method_table != GD_OTHER->method_table) GD_UNIFY_FAIL; @@ -131,7 +132,7 @@ assert(g_allocp == heapp()); Shallow(GD_OTHER); } - GD_RETURN; + set_heapp(g_allocp); } GDDEF_GC() diff -ruN klic-3.003-2002-03-08b/runtime/gobj.h klic-3.003-2002-03-09/runtime/gobj.h --- klic-3.003-2002-03-08b/runtime/gobj.h Wed Feb 20 13:21:57 2002 +++ klic-3.003-2002-03-09/runtime/gobj.h Sat Mar 9 12:09:10 2002 @@ -15,13 +15,13 @@ */ #define method_table_of(obj) ((obj)->method_table) -#define generic_active_unify(obj, anothor, allocp) \ + +#define generic_active_unify(obj, anothor) \ do{ \ - (allocp) = method_table_of(obj)->active_unify((obj), (anothor), (allocp)); \ + method_table_of(obj)->active_unify((obj), (anothor)); \ }while(0) -#define generic_generate(obj, allocp) \ - (method_table_of(obj)->generate((obj), (allocp))) +#define generic_generate(obj) (method_table_of(obj)->generate((obj), heapp())) /*** for Shared-memory KLIC system ***/ #define generic_shmcopy(obj) \ diff -ruN klic-3.003-2002-03-08b/runtime/gpointer.c klic-3.003-2002-03-09/runtime/gpointer.c --- klic-3.003-2002-03-08b/runtime/gpointer.c Tue Mar 5 22:21:11 2002 +++ klic-3.003-2002-03-09/runtime/gpointer.c Sat Mar 9 12:52:08 2002 @@ -30,7 +30,6 @@ if (GD_SELF->method_table != GD_OTHER->method_table) GD_UNIFY_FAIL; if (GD_SELF->pointer != GD_OTHER->pointer) GD_UNIFY_FAIL; - GD_RETURN; } GDDEF_GC() diff -ruN klic-3.003-2002-03-08b/runtime/gstring.c klic-3.003-2002-03-09/runtime/gstring.c --- klic-3.003-2002-03-08b/runtime/gstring.c Tue Mar 5 22:18:42 2002 +++ klic-3.003-2002-03-09/runtime/gstring.c Sat Mar 9 12:53:02 2002 @@ -105,6 +105,7 @@ GDDEF_UNIFY() { G_STD_DECL; + q* g_allocp = heapp(); long size, k; if (GD_SELF->method_table != GD_OTHER->method_table) GD_UNIFY_FAIL; Shallow(GD_SELF); @@ -121,7 +122,7 @@ Shallow(GD_OTHER); } } - GD_RETURN; + set_heapp(g_allocp); } GDDEF_GC() diff -ruN klic-3.003-2002-03-08b/runtime/gtermarray.c klic-3.003-2002-03-09/runtime/gtermarray.c --- klic-3.003-2002-03-08b/runtime/gtermarray.c Tue Mar 5 22:19:05 2002 +++ klic-3.003-2002-03-09/runtime/gtermarray.c Sat Mar 9 12:53:22 2002 @@ -31,7 +31,6 @@ if (GD_SELF->method_table != GD_OTHER->method_table) GD_UNIFY_FAIL; if (GD_SELF->terms != GD_OTHER->terms) GD_UNIFY_FAIL; if (GD_SELF->nterm != GD_OTHER->nterm) GD_UNIFY_FAIL; - GD_RETURN; } GDDEF_GC() diff -ruN klic-3.003-2002-03-08b/runtime/random.c klic-3.003-2002-03-09/runtime/random.c --- klic-3.003-2002-03-08b/runtime/random.c Tue Mar 5 22:20:48 2002 +++ klic-3.003-2002-03-09/runtime/random.c Sat Mar 9 13:06:11 2002 @@ -82,7 +82,7 @@ GGDEF_UNIFY() { - return 0; + set_heapp(NULL); } #define GGUSE_MY_GENERATE diff -ruN klic-3.003-2002-03-08b/runtime/unify.c klic-3.003-2002-03-09/runtime/unify.c --- klic-3.003-2002-03-08b/runtime/unify.c Fri Mar 8 20:10:33 2002 +++ klic-3.003-2002-03-09/runtime/unify.c Sat Mar 9 12:09:04 2002 @@ -89,8 +89,10 @@ q *tempallocp; q backpt = gsusp->backpt; - if((tempallocp = method_table_of(gobj)-> - active_unify(gsusp->backpt, y, allocp))) { + set_heapp(allocp); + method_table_of(gobj)->active_unify(gsusp->backpt, y); + tempallocp = heapp(); + if(tempallocp != NULL) { /* Unify method was succeeded */ allocp = tempallocp; /* @@ -98,7 +100,9 @@ */ } else { /* failed */ - q tmp = generic_generate(gobj, allocp); + q tmp; + set_heapp(allocp); + tmp = generic_generate(gobj); switch((long)tmp) { case (long)makeref(0): @@ -137,7 +141,9 @@ q tmpval; long keepp = loopp->u.l; loopp->u.l = 0; - generic_active_unify(obj, y, allocp); + set_heapp(allocp); + generic_active_unify(obj, y); + allocp = heapp(); switch ((long)method_result) { case (long)GENERIC_FAILED: fatal("Unification failure on a consumer object"); @@ -217,8 +223,10 @@ q *tmpallocp; /* At first, try unify method */ - tmpallocp = (method_table_of(untag_generator_susp(gsx->u.o))-> - active_unify(gsx->backpt, sy->backpt, allocp)); + set_heapp(allocp); + method_table_of(untag_generator_susp(gsx->u.o))-> + active_unify(gsx->backpt, sy->backpt); + tmpallocp = heapp(); if(tmpallocp != (q*)0) { /* succeeded */ allocp = tmpallocp; @@ -229,9 +237,11 @@ /* unify of x is failed */ if(is_generator_susp(sy->u)) { struct generator_susp *gsy = generator_suspp(sy); - q *tempallocp = - method_table_of(untag_generator_susp(gsy->u.o))-> - active_unify(gsy->backpt, gsx->backpt, allocp); + q* tempallocp; + set_heapp(allocp); + method_table_of(untag_generator_susp(gsy->u.o))-> + active_unify(gsy->backpt, gsx->backpt); + tempallocp = heapp(); if(tempallocp != (q*)0) { allocp = tempallocp; /* @@ -241,12 +251,16 @@ /* x and y are both generator, but both failed. */ struct generator_object *gobjx = untag_generator_susp(gsx->u.o); - q tmpx = generic_generate(gobjx, allocp); + q tmpx; + set_heapp(allocp); + tmpx = generic_generate(gobjx); switch((long)tmpx) { case (long)makeref(0): { /* failed */ struct generator_object *gobjy = untag_generator_susp(gsy->u.o); - q tmpy = generic_generate(gobjy, allocp); + q tmpy; + set_heapp(allocp); + tmpy = generic_generate(gobjy); switch((long)tmpy) { case (long)makeref(0): set_heapp(allocp); @@ -286,7 +300,9 @@ /* The unify method for x is failed and y is hook */ struct generator_object *gobjx = untag_generator_susp(gsx->u.o); - q tmpx = generic_generate(gobjx, allocp); + q tmpx; + set_heapp(allocp); + tmpx = generic_generate(gobjx); switch((long)tmpx) { case (long)makeref(0): /* GC request */ set_heapp(allocp); diff -ruN klic-3.003-2002-03-08b/runtime/uterms.kl1 klic-3.003-2002-03-09/runtime/uterms.kl1 --- klic-3.003-2002-03-08b/runtime/uterms.kl1 Fri Feb 22 22:30:12 2002 +++ klic-3.003-2002-03-09/runtime/uterms.kl1 Sat Mar 9 11:37:29 2002 @@ -5,7 +5,7 @@ % (Read COPYRIGHT-JIPDEC for detailed information.) ----------------------------------------------------------- */ -:- inline:"#include \"gobj.h\"". +:- inline:"#include \"gobj.h\" /* generic_active_unify */". :- module unify_term_dcode. @@ -15,15 +15,15 @@ unify_pf(PX, PY), unify_args(A, X, Y). -unify_pf(PX, PY) :- - inline:" - if (isatomic(%0)) { - if (%0 != %1) goto %f; - } else if (isatomic(%1)) { - goto %f; - } else { - generic_active_unify(data_objectp(%0), data_objectp(%1), allocp); - }": [PX+bound, PY+bound] | true. +unify_pf(PX, PY) :- inline:" + if (isatomic(%0)) { + if (%0 != %1) goto %f; + } else { + if (isatomic(%1)) goto %f; + set_heapp(allocp); + generic_active_unify(data_objectp(%0), data_objectp(%1)); + allocp = heapp(); + }": [PX+bound, PY+bound] | true. unify_args(0, _, _) :- true | true. diff -ruN klic-3.003-2002-03-08b/runtime/wakeup.c klic-3.003-2002-03-09/runtime/wakeup.c --- klic-3.003-2002-03-08b/runtime/wakeup.c Tue Mar 5 22:19:20 2002 +++ klic-3.003-2002-03-09/runtime/wakeup.c Sat Mar 9 13:11:42 2002 @@ -26,6 +26,7 @@ GCDEF_UNIFY() { G_STD_DECL; + q* g_allocp = heapp(); GC_KL1_UNIFY(GC_SELF->x,GC_SELF->y); assert(g_allocp >= heapp() + 4);