mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-08 13:37:33 +02:00
Working around mark-free-list problem for now, need to revisit this.
This commit is contained in:
parent
469cfa4c08
commit
3e7877b402
2 changed files with 5 additions and 2 deletions
2
gc.c
2
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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue