Project

General

Profile

Feature #15833 » 0001-Name-RArray-member-to-count-reference-of-shared-root.patch

wanabe (_ wanabe), 05/06/2019 10:01 AM

View differences:

array.c
#define RARRAY_SHARED_ROOT_FLAG FL_USER5
#define ARY_SHARED_ROOT_P(ary) (FL_TEST((ary), RARRAY_SHARED_ROOT_FLAG))
#define ARY_SHARED_NUM(ary) \
(assert(ARY_SHARED_ROOT_P(ary)), RARRAY(ary)->as.heap.aux.capa)
(assert(ARY_SHARED_ROOT_P(ary)), RARRAY(ary)->as.heap.aux.shared_num)
#define ARY_SHARED_OCCUPIED(ary) (ARY_SHARED_NUM(ary) == 1)
#define ARY_SET_SHARED_NUM(ary, value) do { \
assert(ARY_SHARED_ROOT_P(ary)); \
RARRAY(ary)->as.heap.aux.capa = (value); \
RARRAY(ary)->as.heap.aux.shared_num = (value); \
} while (0)
#define FL_SET_SHARED_ROOT(ary) do { \
assert(!ARY_EMBED_P(ary)); \
include/ruby/ruby.h
union {
long capa;
VALUE shared;
long shared_num;
} aux;
const VALUE *ptr;
} heap;
(1-1/3)