diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-05-09 06:12:17 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-05-09 06:12:17 +0000 |
commit | 58823392b465ef50819f36994be5a75a91da6ecc (patch) | |
tree | afe8e53929c163c73b3eb678b5946db5dfb0e77b /gc.c | |
parent | 75d5cf55dea0c1351ebd37d432545935698c5c18 (diff) |
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.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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; |