aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-26 08:45:14 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-26 08:45:14 +0000
commit8f3b01136a43eb1a97fa1a0e8e3eebbc485b16e3 (patch)
tree3719401c417677be1ed4a8d69ded3e052e6baabc /gc.c
parentf42d8c8d41315b32a3d4acc53a711d59cd1382f4 (diff)
downloadruby-8f3b01136a43eb1a97fa1a0e8e3eebbc485b16e3.tar.gz
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
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gc.c b/gc.c
index f2afe8499e..635fbb9db0 100644
--- a/gc.c
+++ b/gc.c
@@ -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)
{