mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 16:57:35 +02:00
Add immutable field to the object header
This commit is contained in:
parent
b1cdb81177
commit
8d98dc1a15
1 changed files with 6 additions and 2 deletions
|
@ -239,6 +239,7 @@ typedef struct gc_header_type_t gc_header_type;
|
|||
struct gc_header_type_t {
|
||||
unsigned char mark; // mark bits
|
||||
unsigned char grayed; // stack object to be grayed when moved to heap
|
||||
unsigned char immutable; // Flag normally mutable obj (EG: pair) as read-only
|
||||
};
|
||||
|
||||
/** Get an object's `mark` value */
|
||||
|
@ -247,6 +248,9 @@ struct gc_header_type_t {
|
|||
/** Get an object's `grayed` value */
|
||||
#define grayed(x) (((list) x)->hdr.grayed)
|
||||
|
||||
//** Access an object's "immutable" field */
|
||||
#define immutable(x) (((list) x)->hdr.immutable)
|
||||
|
||||
/** Enums for tri-color marking */
|
||||
typedef enum { STATUS_ASYNC, STATUS_SYNC1, STATUS_SYNC2
|
||||
} gc_status_type;
|
||||
|
|
Loading…
Add table
Reference in a new issue