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

ruby-changes:63983

From: Koichi <ko1@a...>
Date: Mon, 7 Dec 2020 08:29:07 +0900 (JST)
Subject: [ruby-changes:63983] 59ddb88da6 (master): RB_EC_NEWOBJ_OF

https://git.ruby-lang.org/ruby.git/commit/?id=59ddb88da6

From 59ddb88da6bf483eeec7b85b8a85cf3719edf440 Mon Sep 17 00:00:00 2001
From: Koichi Sasada <ko1@a...>
Date: Sun, 6 Dec 2020 15:40:16 +0900
Subject: RB_EC_NEWOBJ_OF

NEWOBJ with current ec.

diff --git a/gc.c b/gc.c
index ea21e61..6f683cb 100644
--- a/gc.c
+++ b/gc.c
@@ -2335,7 +2335,7 @@ rb_wb_protected_newobj_of(VALUE klass, VALUE flags) https://github.com/ruby/ruby/blob/trunk/gc.c#L2335
 }
 
 VALUE
-rb_wb_protected_newobj_of_ec(rb_execution_context_t *ec, VALUE klass, VALUE flags)
+rb_ec_wb_protected_newobj_of(rb_execution_context_t *ec, VALUE klass, VALUE flags)
 {
     GC_ASSERT((flags & FL_WB_PROTECTED) == 0);
     return newobj_of_cr(rb_ec_ractor_ptr(ec), klass, flags, 0, 0, 0, TRUE);
diff --git a/internal/gc.h b/internal/gc.h
index 490f42e..ed8616d 100644
--- a/internal/gc.h
+++ b/internal/gc.h
@@ -30,6 +30,12 @@ struct rb_objspace; /* in vm_core.h */ https://github.com/ruby/ruby/blob/trunk/internal/gc.h#L30
   T *(var) = (T *)(((f) & FL_WB_PROTECTED) ? \
                    rb_wb_protected_newobj_of((c), (f) & ~FL_WB_PROTECTED) : \
                    rb_wb_unprotected_newobj_of((c), (f)))
+
+#define RB_EC_NEWOBJ_OF(ec, var, T, c, f) \
+  T *(var) = (T *)(((f) & FL_WB_PROTECTED) ? \
+                   rb_ec_wb_protected_newobj_of((ec), (c), (f) & ~FL_WB_PROTECTED) : \
+                   rb_wb_unprotected_newobj_of((c), (f)))
+
 #define NEWOBJ_OF(var, T, c, f) RB_NEWOBJ_OF((var), T, (c), (f))
 #define RB_OBJ_GC_FLAGS_MAX 6   /* used in ext/objspace */
 
@@ -85,6 +91,7 @@ RUBY_SYMBOL_EXPORT_BEGIN https://github.com/ruby/ruby/blob/trunk/internal/gc.h#L91
 const char *rb_objspace_data_type_name(VALUE obj);
 VALUE rb_wb_protected_newobj_of(VALUE, VALUE);
 VALUE rb_wb_unprotected_newobj_of(VALUE, VALUE);
+VALUE rb_ec_wb_protected_newobj_of(struct rb_execution_context_struct *ec, VALUE klass, VALUE flags);
 size_t rb_obj_memsize_of(VALUE);
 void rb_gc_verify_internal_consistency(void);
 size_t rb_obj_gc_flags(VALUE, ID[], size_t);
-- 
cgit v0.10.2


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

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