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
128 128
#define RARRAY_SHARED_ROOT_FLAG FL_USER5
129 129
#define ARY_SHARED_ROOT_P(ary) (FL_TEST((ary), RARRAY_SHARED_ROOT_FLAG))
130 130
#define ARY_SHARED_NUM(ary) \
131
    (assert(ARY_SHARED_ROOT_P(ary)), RARRAY(ary)->as.heap.aux.capa)
131
    (assert(ARY_SHARED_ROOT_P(ary)), RARRAY(ary)->as.heap.aux.shared_num)
132 132
#define ARY_SHARED_OCCUPIED(ary) (ARY_SHARED_NUM(ary) == 1)
133 133
#define ARY_SET_SHARED_NUM(ary, value) do { \
134 134
    assert(ARY_SHARED_ROOT_P(ary)); \
135
    RARRAY(ary)->as.heap.aux.capa = (value); \
135
    RARRAY(ary)->as.heap.aux.shared_num = (value); \
136 136
} while (0)
137 137
#define FL_SET_SHARED_ROOT(ary) do { \
138 138
    assert(!ARY_EMBED_P(ary)); \
include/ruby/ruby.h
1054 1054
	    union {
1055 1055
		long capa;
1056 1056
		VALUE shared;
1057
                long shared_num;
1057 1058
	    } aux;
1058 1059
	    const VALUE *ptr;
1059 1060
	} heap;