Expand the definition of rb_imemo_new in rb_imemo_alloc_new

per ko1's comment

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2017-10-26 08:45:14 +00:00
parent e6309f0d50
commit 5f4a08253b

15
gc.c
View File

@ -2017,6 +2017,13 @@ rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0)
return newobj_of(v0, flags, v1, v2, v3, TRUE);
}
rb_imemo_alloc_t *
rb_imemo_alloc_new(VALUE v1, VALUE v2, VALUE v3, VALUE v0)
{
VALUE flags = T_IMEMO | (imemo_alloc << FL_USHIFT);
return (rb_imemo_alloc_t *)newobj_of(v0, flags, v1, v2, v3, FALSE);
}
#if IMEMO_DEBUG
VALUE
rb_imemo_new_debug(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0, const char *file, int line)
@ -8110,14 +8117,6 @@ ruby_mimfree(void *ptr)
free(mem);
}
rb_imemo_alloc_t *
rb_imemo_alloc_new(VALUE v1, VALUE v2, VALUE v3, VALUE v0)
{
VALUE s = rb_imemo_new(imemo_alloc, v1, v2, v3, v0);
rb_gc_writebarrier_unprotect(s);
return (rb_imemo_alloc_t *)s;
}
void *
rb_alloc_tmp_buffer_with_count(volatile VALUE *store, size_t size, size_t cnt)
{