mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
object.h: rename gccolor to clearer gc_color
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
struct RClass *c; \
|
||||
struct RBasic *gcnext; \
|
||||
enum mrb_vtype tt:8; \
|
||||
unsigned int gccolor:3; \
|
||||
unsigned int gc_color:3; \
|
||||
unsigned int frozen:1; \
|
||||
uint32_t flags:20
|
||||
|
||||
|
||||
+1
-1
@@ -790,7 +790,7 @@ mrb_define_method_raw(mrb_state *mrb, struct RClass *c, mrb_sym mid, mrb_method_
|
||||
|
||||
ptr.proc = p;
|
||||
if (p) {
|
||||
if (p->gccolor != MRB_GC_RED) {
|
||||
if (p->gc_color != MRB_GC_RED) {
|
||||
p->flags |= MRB_PROC_SCOPE;
|
||||
p->c = NULL;
|
||||
mrb_field_write_barrier(mrb, (struct RBasic*)c, (struct RBasic*)p);
|
||||
|
||||
@@ -170,17 +170,17 @@ typedef struct mrb_heap_page {
|
||||
#define GC_COLOR_MASK 7
|
||||
mrb_static_assert(MRB_GC_RED <= GC_COLOR_MASK);
|
||||
|
||||
#define paint_gray(o) ((o)->gccolor = GC_GRAY)
|
||||
#define paint_black(o) ((o)->gccolor = GC_BLACK)
|
||||
#define paint_white(o) ((o)->gccolor = GC_WHITES)
|
||||
#define paint_partial_white(s, o) ((o)->gccolor = (s)->current_white_part)
|
||||
#define is_gray(o) ((o)->gccolor == GC_GRAY)
|
||||
#define is_white(o) ((o)->gccolor & GC_WHITES)
|
||||
#define is_black(o) ((o)->gccolor == GC_BLACK)
|
||||
#define is_red(o) ((o)->gccolor == GC_RED)
|
||||
#define paint_gray(o) ((o)->gc_color = GC_GRAY)
|
||||
#define paint_black(o) ((o)->gc_color = GC_BLACK)
|
||||
#define paint_white(o) ((o)->gc_color = GC_WHITES)
|
||||
#define paint_partial_white(s, o) ((o)->gc_color = (s)->current_white_part)
|
||||
#define is_gray(o) ((o)->gc_color == GC_GRAY)
|
||||
#define is_white(o) ((o)->gc_color & GC_WHITES)
|
||||
#define is_black(o) ((o)->gc_color == GC_BLACK)
|
||||
#define is_red(o) ((o)->gc_color == GC_RED)
|
||||
#define flip_white_part(s) ((s)->current_white_part = other_white_part(s))
|
||||
#define other_white_part(s) ((s)->current_white_part ^ GC_WHITES)
|
||||
#define is_dead(s, o) (((o)->gccolor & other_white_part(s) & GC_WHITES) || (o)->tt == MRB_TT_FREE)
|
||||
#define is_dead(s, o) (((o)->gc_color & other_white_part(s) & GC_WHITES) || (o)->tt == MRB_TT_FREE)
|
||||
|
||||
mrb_noreturn void mrb_raise_nomemory(mrb_state *mrb);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user