diff --git a/gc.c b/gc.c index f212b1bb..88ffeb52 100644 --- a/gc.c +++ b/gc.c @@ -17,7 +17,7 @@ // Note: will need to use atomics and/or locking to access any // variables shared between threads -static int gc_color_mark = 2; // Black, is swapped during GC +static int gc_color_mark = 1; // Black, is swapped during GC static int gc_color_clear = 3; // White, is swapped during GC //static const int gc_color_grey = 4; // TODO: appears unused, clean up // unfortunately this had to be split up; const colors are located in types.h diff --git a/include/cyclone/types.h b/include/cyclone/types.h index 75cae0a5..c3c7ab45 100644 --- a/include/cyclone/types.h +++ b/include/cyclone/types.h @@ -65,6 +65,9 @@ struct gc_thread_data_t { typedef struct gc_free_list_t gc_free_list; struct gc_free_list_t { +// somehow this size param is being overwritten by a "mark() =". +// how could that happen? +unsigned int dummy; // just for testing/evaluation unsigned int size; gc_free_list *next; }; @@ -117,7 +120,7 @@ typedef enum { STAGE_CLEAR_OR_MARKING // The mark/clear colors are defined in the gc module because // the collector swaps their values as an optimization. #define gc_color_red 0 // Memory not to be GC'd, such as on the stack -#define gc_color_blue 1 // Unallocated memory +#define gc_color_blue 2 // Unallocated memory /* Utility functions */ void **vpbuffer_realloc(void **buf, int *len);