[前][次][番号順一覧][スレッド一覧]

ruby-changes:48329

From: mame <ko1@a...>
Date: Thu, 26 Oct 2017 17:45:21 +0900 (JST)
Subject: [ruby-changes:48329] mame:r60443 (trunk): Expand the definition of rb_imemo_new in rb_imemo_alloc_new

mame	2017-10-26 17:45:14 +0900 (Thu, 26 Oct 2017)

  New Revision: 60443

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60443

  Log:
    Expand the definition of rb_imemo_new in rb_imemo_alloc_new
    
    per ko1's comment

  Modified files:
    trunk/gc.c
Index: gc.c
===================================================================
--- gc.c	(revision 60442)
+++ gc.c	(revision 60443)
@@ -2017,6 +2017,13 @@ rb_imemo_new(enum imemo_type type, VALUE https://github.com/ruby/ruby/blob/trunk/gc.c#L2017
     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) https://github.com/ruby/ruby/blob/trunk/gc.c#L8117
     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)
 {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]