diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-26 08:45:14 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-26 08:45:14 +0000 |
commit | 5f4a08253bfbeaca5e4e454594961b4d46035f17 (patch) | |
tree | 3719401c417677be1ed4a8d69ded3e052e6baabc | |
parent | e6309f0d50ae498fe259866c8d5bbb7829ddcec5 (diff) |
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
-rw-r--r-- | gc.c | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -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) { |