Changed color values

Many types are allocated with a zeroed-out header, so making the red color 0 is now consistent with that code.
This commit is contained in:
Justin Ethier 2015-10-30 18:50:33 -04:00
parent bfc9160c95
commit be4fd84d63
2 changed files with 5 additions and 5 deletions

6
gc.c
View file

@ -438,9 +438,9 @@ PHASE 2 - multi-threaded mutator (IE, more than one stack thread):
// //
// Note: will need to use atomics and/or locking to access any // Note: will need to use atomics and/or locking to access any
// variables shared between threads // variables shared between threads
static int gc_color_mark = 0; // Black, is swapped during GC static int gc_color_mark = 2; // Black, is swapped during GC
//static const int gc_color_grey = 1; // TODO: appears unused, clean up static int gc_color_clear = 3; // White, is swapped during GC
static int gc_color_clear = 2; // 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 // unfortunately this had to be split up; const colors are located in types.h
static int gc_status_col; static int gc_status_col;

View file

@ -91,8 +91,8 @@ typedef enum { STAGE_CLEAR_OR_MARKING
// Constant colors are defined here. // Constant colors are defined here.
// The mark/clear colors are defined in the gc module because // The mark/clear colors are defined in the gc module because
// the collector swaps their values as an optimization. // the collector swaps their values as an optimization.
const int gc_color_blue = 3; // Unallocate memory const int gc_color_red = 0; // Memory not to be GC'd, such as on the stack
const int gc_color_red = 4; // Memory on the stack const int gc_color_blue = 1; // Unallocated memory
/* Utility functions */ /* Utility functions */
void **vpbuffer_realloc(void **buf, int *len); void **vpbuffer_realloc(void **buf, int *len);