GitHub

Original file line numberDiff line numberDiff line change

@@ -11,7 +11,7 @@

1111

struct RClass *c; \

1212

struct RBasic *gcnext; \

1313

enum mrb_vtype tt:8; \

14-

unsigned int gccolor:3; \

14+

unsigned int gc_color:3; \

1515

unsigned int frozen:1; \

1616

uint32_t flags:20

1717
Original file line numberDiff line numberDiff line change

@@ -790,7 +790,7 @@ mrb_define_method_raw(mrb_state *mrb, struct RClass *c, mrb_sym mid, mrb_method_

790790
791791

ptr.proc = p;

792792

if (p) {

793-

if (p->gccolor != MRB_GC_RED) {

793+

if (p->gc_color != MRB_GC_RED) {

794794

p->flags |= MRB_PROC_SCOPE;

795795

p->c = NULL;

796796

mrb_field_write_barrier(mrb, (struct RBasic*)c, (struct RBasic*)p);

Original file line numberDiff line numberDiff line change

@@ -170,17 +170,17 @@ typedef struct mrb_heap_page {

170170

#define GC_COLOR_MASK 7

171171

mrb_static_assert(MRB_GC_RED <= GC_COLOR_MASK);

172172
173-

#define paint_gray(o) ((o)->gccolor = GC_GRAY)

174-

#define paint_black(o) ((o)->gccolor = GC_BLACK)

175-

#define paint_white(o) ((o)->gccolor = GC_WHITES)

176-

#define paint_partial_white(s, o) ((o)->gccolor = (s)->current_white_part)

177-

#define is_gray(o) ((o)->gccolor == GC_GRAY)

178-

#define is_white(o) ((o)->gccolor & GC_WHITES)

179-

#define is_black(o) ((o)->gccolor == GC_BLACK)

180-

#define is_red(o) ((o)->gccolor == GC_RED)

173+

#define paint_gray(o) ((o)->gc_color = GC_GRAY)

174+

#define paint_black(o) ((o)->gc_color = GC_BLACK)

175+

#define paint_white(o) ((o)->gc_color = GC_WHITES)

176+

#define paint_partial_white(s, o) ((o)->gc_color = (s)->current_white_part)

177+

#define is_gray(o) ((o)->gc_color == GC_GRAY)

178+

#define is_white(o) ((o)->gc_color & GC_WHITES)

179+

#define is_black(o) ((o)->gc_color == GC_BLACK)

180+

#define is_red(o) ((o)->gc_color == GC_RED)

181181

#define flip_white_part(s) ((s)->current_white_part = other_white_part(s))

182182

#define other_white_part(s) ((s)->current_white_part ^ GC_WHITES)

183-

#define is_dead(s, o) (((o)->gccolor & other_white_part(s) & GC_WHITES) || (o)->tt == MRB_TT_FREE)

183+

#define is_dead(s, o) (((o)->gc_color & other_white_part(s) & GC_WHITES) || (o)->tt == MRB_TT_FREE)

184184
185185

mrb_noreturn void mrb_raise_nomemory(mrb_state *mrb);

186186

Read the original on github.com ↗