Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 25 additions & 11 deletions defs/gmake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -541,24 +541,25 @@ ruby.pc: $(filter-out ruby.pc,$(ruby_pc))
# Just update the version in the title of NEWS.md.

matz: up
matz: OLD := $(MAJOR).$(MINOR).0
matz-commit: OLD := $(MAJOR).$(MINOR).0
ifdef NEW
matz: MAJOR := $(word 1,$(subst ., ,$(NEW)))
matz: MINOR := $(word 2,$(subst ., ,$(NEW)))
matz: $(DOT_WAIT) bump_news
matz-commit: MAJOR := $(word 1,$(subst ., ,$(NEW)))
matz-commit: MINOR := $(word 2,$(subst ., ,$(NEW)))
matz-commit: $(DOT_WAIT) bump_news
bump_news$(DOT_WAIT): up
bump_headers$(DOT_WAIT): bump_news
else
matz: MINOR := $(shell expr $(MINOR) + 1)
matz: $(DOT_WAIT) reset_news
matz-commit: MINOR := $(shell expr $(MINOR) + 1)
matz-commit: $(DOT_WAIT) reset_news
flush_news$(DOT_WAIT): up
bump_headers$(DOT_WAIT): reset_news
endif

matz: $(DOT_WAIT) bump_headers
matz: override NEW := $(MAJOR).$(MINOR).0
matz: files := include/ruby/version.h include/ruby/internal/abi.h
matz: message := Development of $(NEW) started.
matz: $(DOT_WAIT) matz-commit
matz-commit: bump_headers
matz-commit: override NEW := $(MAJOR).$(MINOR).0
matz-commit: files := include/ruby/version.h include/ruby/internal/abi.h
matz-commit: message := Development of $(NEW) started.

flush_news:
$(GIT_IN_SRC) mv -f NEWS.md doc/NEWS/NEWS-$(OLD).md
Expand Down Expand Up @@ -589,10 +590,23 @@ bump_news:
-e 'BEGIN {new = ARGV.shift; print gets("").sub(/Ruby \K[0-9.]+/, new)}' \
$(NEW) NEWS.md

matz:
matz: matz-commit matz-push

matz-commit:
$(GIT_IN_SRC) add NEWS.md $(files)
$(GIT_IN_SRC) commit -m "$(message)"

GIT_REMOTE_ORIGIN = origin

matz-push: matz-commit
$(eval origin_url := $(shell $(GIT_IN_SRC) remote get-url $(GIT_REMOTE_ORIGIN)))
$(if $(origin_url),,@false)
$(eval last_commit := $(shell $(GIT_IN_SRC) log -n1 --format=%H --author=matz HEAD~..HEAD))
$(if $(last_commit),,$(ECHO) No matz commits 1>&2; false)
$(if $(filter 12-25 12-26,$(shell date +%m-%d)),,$(ECHO) Not the release date 1>&2; false)
$(ECHO) $$'\e[31m'Pushing to $$'\e[7m'$(GIT_REMOTE_ORIGIN)$$'\e[27m'" ($(origin_url))"$$'\e[m'
$(GIT_IN_SRC) push $(GIT_REMOTE_ORIGIN)

tags:
$(MAKE) GIT="$(GIT)" -C "$(srcdir)" -f defs/tags.mk

Expand Down
5 changes: 2 additions & 3 deletions gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2461,9 +2461,8 @@ rb_obj_memsize_of(VALUE obj)
break;

case T_STRUCT:
if ((RBASIC(obj)->flags & RSTRUCT_EMBED_LEN_MASK) == 0 &&
RSTRUCT(obj)->as.heap.ptr) {
size += sizeof(VALUE) * RSTRUCT_LEN(obj);
if (RSTRUCT_EMBED_LEN(obj) == 0) {
size += sizeof(VALUE) * RSTRUCT_LEN_RAW(obj);
}
break;

Expand Down
2 changes: 0 additions & 2 deletions include/ruby/backward/cxxanyargs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,7 @@ struct driver {
* this writing the version is 2.8. Let's warn this later, some time
* during 3.x. Hopefully codes in old (ANYARGS-ed) format should be
* less than now. */
#if (RUBY_API_VERSION_MAJOR * 100 + RUBY_API_VERSION_MINOR) >= 301
RUBY_CXX_DEPRECATED("use of ANYARGS is deprecated")
#endif
/// @copydoc define(VALUE klass, T mid, U func)
/// @deprecated Pass correctly typed function instead.
static inline void
Expand Down
6 changes: 3 additions & 3 deletions internal/range.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ static inline VALUE RANGE_EXCL(VALUE r);
static inline VALUE
RANGE_BEG(VALUE r)
{
return RSTRUCT(r)->as.ary[0];
return RSTRUCT_GET_RAW(r, 0);
}

static inline VALUE
RANGE_END(VALUE r)
{
return RSTRUCT_GET(r, 1);
return RSTRUCT_GET_RAW(r, 1);
}

static inline VALUE
RANGE_EXCL(VALUE r)
{
return RSTRUCT_GET(r, 2);
return RSTRUCT_GET_RAW(r, 2);
}

VALUE
Expand Down
38 changes: 9 additions & 29 deletions internal/struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,36 +49,16 @@ struct RStruct {

#define RSTRUCT(obj) ((struct RStruct *)(obj))

#ifdef RSTRUCT_LEN
# undef RSTRUCT_LEN
#endif

#ifdef RSTRUCT_PTR
# undef RSTRUCT_PTR
#endif

#ifdef RSTRUCT_SET
# undef RSTRUCT_SET
#endif

#ifdef RSTRUCT_GET
# undef RSTRUCT_GET
#endif

#define RSTRUCT_LEN internal_RSTRUCT_LEN
#define RSTRUCT_SET internal_RSTRUCT_SET
#define RSTRUCT_GET internal_RSTRUCT_GET

/* struct.c */
VALUE rb_struct_init_copy(VALUE copy, VALUE s);
VALUE rb_struct_lookup(VALUE s, VALUE idx);
VALUE rb_struct_s_keyword_init(VALUE klass);
static inline long RSTRUCT_EMBED_LEN(VALUE st);
static inline long RSTRUCT_LEN(VALUE st);
static inline long RSTRUCT_LEN_RAW(VALUE st);
static inline int RSTRUCT_LENINT(VALUE st);
static inline const VALUE *RSTRUCT_CONST_PTR(VALUE st);
static inline void RSTRUCT_SET(VALUE st, long k, VALUE v);
static inline VALUE RSTRUCT_GET(VALUE st, long k);
static inline void RSTRUCT_SET_RAW(VALUE st, long k, VALUE v);
static inline VALUE RSTRUCT_GET_RAW(VALUE st, long k);

static inline long
RSTRUCT_EMBED_LEN(VALUE st)
Expand All @@ -89,7 +69,7 @@ RSTRUCT_EMBED_LEN(VALUE st)
}

static inline long
RSTRUCT_LEN(VALUE st)
RSTRUCT_LEN_RAW(VALUE st)
{
if (FL_TEST_RAW(st, RSTRUCT_EMBED_LEN_MASK)) {
return RSTRUCT_EMBED_LEN(st);
Expand All @@ -102,7 +82,7 @@ RSTRUCT_LEN(VALUE st)
static inline int
RSTRUCT_LENINT(VALUE st)
{
return rb_long2int(RSTRUCT_LEN(st));
return rb_long2int(RSTRUCT_LEN_RAW(st));
}

static inline const VALUE *
Expand All @@ -119,13 +99,13 @@ RSTRUCT_CONST_PTR(VALUE st)
}

static inline void
RSTRUCT_SET(VALUE st, long k, VALUE v)
RSTRUCT_SET_RAW(VALUE st, long k, VALUE v)
{
RB_OBJ_WRITE(st, &RSTRUCT_CONST_PTR(st)[k], v);
}

static inline VALUE
RSTRUCT_GET(VALUE st, long k)
RSTRUCT_GET_RAW(VALUE st, long k)
{
return RSTRUCT_CONST_PTR(st)[k];
}
Expand All @@ -137,7 +117,7 @@ RSTRUCT_FIELDS_OBJ(VALUE st)
VALUE fields_obj;
if (embed_len) {
RUBY_ASSERT(!FL_TEST_RAW(st, RSTRUCT_GEN_FIELDS));
fields_obj = RSTRUCT_GET(st, embed_len);
fields_obj = RSTRUCT_GET_RAW(st, embed_len);
}
else {
fields_obj = RSTRUCT(st)->as.heap.fields_obj;
Expand All @@ -151,7 +131,7 @@ RSTRUCT_SET_FIELDS_OBJ(VALUE st, VALUE fields_obj)
const long embed_len = RSTRUCT_EMBED_LEN(st);
if (embed_len) {
RUBY_ASSERT(!FL_TEST_RAW(st, RSTRUCT_GEN_FIELDS));
RSTRUCT_SET(st, embed_len, fields_obj);
RSTRUCT_SET_RAW(st, embed_len, fields_obj);
}
else {
RB_OBJ_WRITE(st, &RSTRUCT(st)->as.heap.fields_obj, fields_obj);
Expand Down
4 changes: 2 additions & 2 deletions marshal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1084,15 +1084,15 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
case T_STRUCT:
w_class(TYPE_STRUCT, obj, arg, TRUE);
{
long len = RSTRUCT_LEN(obj);
long len = RSTRUCT_LEN_RAW(obj);
VALUE mem;
long i;

w_long(len, arg);
mem = rb_struct_members(obj);
for (i=0; i<len; i++) {
w_symbol(RARRAY_AREF(mem, i), arg);
w_object(RSTRUCT_GET(obj, i), arg, limit);
w_object(RSTRUCT_GET_RAW(obj, i), arg, limit);
}
}
break;
Expand Down
2 changes: 1 addition & 1 deletion pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ pack_pack(rb_execution_context_t *ec, VALUE ary, VALUE fmt, VALUE buffer)

case 'w': /* BER compressed integer */
while (len-- > 0) {
VALUE buf = rb_str_new(0, 0);
VALUE buf;
size_t numbytes;
int sign;
char *cp;
Expand Down
4 changes: 2 additions & 2 deletions ractor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ obj_traverse_i(VALUE obj, struct obj_traverse_data *data)

case T_STRUCT:
{
long len = RSTRUCT_LEN(obj);
long len = RSTRUCT_LEN_RAW(obj);
const VALUE *ptr = RSTRUCT_CONST_PTR(obj);

for (long i=0; i<len; i++) {
Expand Down Expand Up @@ -1909,7 +1909,7 @@ obj_traverse_replace_i(VALUE obj, struct obj_traverse_replace_data *data)

case T_STRUCT:
{
long len = RSTRUCT_LEN(obj);
long len = RSTRUCT_LEN_RAW(obj);
const VALUE *ptr = RSTRUCT_CONST_PTR(obj);

for (long i=0; i<len; i++) {
Expand Down
Loading