the garbage collection code uses the /sign/ of a pointer as a sort of flag. pure evil. at least in my system, statically allocated and heap allocated pointers have different signs. this patch replaces that with a more explicit flag. diff -Naur scheme-3.2-orig/architecture.c scheme-3.2/architecture.c --- scheme-3.2-orig/architecture.c 1996-01-21 20:15:47.000000000 -0200 +++ scheme-3.2/architecture.c 2006-02-14 14:54:23.000000000 -0200 @@ -145,6 +145,7 @@ { /* Enough space now, or was before. */ new = (Object)&Heap[Working][Free]; + memset(new, 0, size); #if (ALIGNMENT-1) /* Alignment (if not 1; defined in portable.h) */ diff -Naur scheme-3.2-orig/architecture.h scheme-3.2/architecture.h --- scheme-3.2-orig/architecture.h 1996-01-21 20:15:48.000000000 -0200 +++ scheme-3.2/architecture.h 2006-02-14 14:57:40.000000000 -0200 @@ -95,16 +95,11 @@ Import Object Move_Object(); Import void Relocate(); -#if NEGATIVE_ADDRESSES - /* NEGATIVE_ADDRESSES defined in portable.h */ -#define Is_Forwarded(o) (((Integral_Pointer) Get_Type(o)) > 0) -#else -#define Is_Forwarded(o) (((Integral_Pointer) Get_Type(o)) < 0) -#endif +#define Is_Forwarded(o) Get_Forward_Flag(o) +#define Get_Forwarding_Address(o) (Object)Get_Type(o) +#define Set_Forwarding_Address(old, new) Get_Forward_Flag(old) = 1; \ + Get_Type(old) = (Scheme_Type)new; -#define Get_Forwarding_Address(o) ((Object) (-((Integral_Pointer) Get_Type(o)))) -#define Set_Forwarding_Address(old,new) \ - Get_Type(old) = (Scheme_Type) (-((Integral_Pointer)(new))) /* General */ Import Object Copy_Object(); diff -Naur scheme-3.2-orig/object.h scheme-3.2/object.h --- scheme-3.2-orig/object.h 1996-01-21 20:15:51.000000000 -0200 +++ scheme-3.2/object.h 2006-02-14 14:56:47.000000000 -0200 @@ -89,11 +89,13 @@ { Scheme_Type Type; String Type_Name; + int forward_flag; } Common_Struct; /* And a way to access the common fields. */ #define Get_Type(o) ((o)->Common.Type) +#define Get_Forward_Flag(o) ((o)->Common.forward_flag) #define Get_Type_Name(o) ((o)->Common.Type_Name) #define Eval_Object(o) ((Get_Type(o)->Eval)(o))