aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-09 06:12:17 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-09 06:12:17 +0000
commite3d85313e4d25f2962b5032d72177e116f48faf6 (patch)
treeafe8e53929c163c73b3eb678b5946db5dfb0e77b /gc.c
parent4058446709f6907d3446787efdb305c64a2a1ef4 (diff)
downloadruby-e3d85313e4d25f2962b5032d72177e116f48faf6.tar.gz
gc.c (rb_imemo_alloc_new): improve the API interface
rb_imemo_alloc_new returns rb_imemo_alloc_t*, but took VALUEs, which is inconsistent. To make the intention clear, it now takes only a pointer to the buffer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gc.c b/gc.c
index b9c1305060..210bef053f 100644
--- a/gc.c
+++ b/gc.c
@@ -2025,10 +2025,10 @@ rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0)
}
rb_imemo_alloc_t *
-rb_imemo_alloc_new(VALUE v1, VALUE v2, VALUE v3, VALUE v0)
+rb_imemo_alloc_new(void *buf)
{
VALUE flags = T_IMEMO | (imemo_alloc << FL_USHIFT);
- return (rb_imemo_alloc_t *)newobj_of(v0, flags, v1, v2, v3, FALSE);
+ return (rb_imemo_alloc_t *)newobj_of(0, flags, (VALUE)buf, 0, 0, FALSE);
}
#if IMEMO_DEBUG
@@ -8125,9 +8125,8 @@ rb_alloc_tmp_buffer_with_count(volatile VALUE *store, size_t size, size_t cnt)
rb_imemo_alloc_t *s;
void *ptr;
- s = rb_imemo_alloc_new(0, 0, 0, 0);
ptr = ruby_xmalloc0(size);
- s->ptr = (VALUE*)ptr;
+ s = rb_imemo_alloc_new(ptr);
s->cnt = cnt;
*store = (VALUE)s;
return ptr;