Working around mark-free-list problem for now, need to revisit this.

This commit is contained in:
Justin Ethier 2015-11-24 23:09:49 -05:00
parent 469cfa4c08
commit 3e7877b402
2 changed files with 5 additions and 2 deletions

2
gc.c
View file

@ -17,7 +17,7 @@
// 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 = 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 int gc_color_clear = 3; // White, is swapped during GC
//static const int gc_color_grey = 4; // TODO: appears unused, clean up //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

View file

@ -65,6 +65,9 @@ struct gc_thread_data_t {
typedef struct gc_free_list_t gc_free_list; typedef struct gc_free_list_t gc_free_list;
struct gc_free_list_t { 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; unsigned int size;
gc_free_list *next; 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 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.
#define gc_color_red 0 // Memory not to be GC'd, such as on the stack #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 */ /* Utility functions */
void **vpbuffer_realloc(void **buf, int *len); void **vpbuffer_realloc(void **buf, int *len);