summaryrefslogtreecommitdiff
path: root/ractor.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-12-03 15:57:39 +0900
committerKoichi Sasada <ko1@atdot.net>2020-12-07 08:28:36 +0900
commit91d99025e4776885ceea809123a129cb31cd1db6 (patch)
tree9fe8e6297666c2f48617630db378d8a4e6e3cf7c /ractor.c
parent1d0bf3d8dd8de40d498a7c2784a84aa566d290b9 (diff)
per-ractor object allocation
Now object allocation requires VM global lock to synchronize objspace. However, of course, it introduces huge overhead. This patch caches some slots (in a page) by each ractor and use cached slots for object allocation. If there is no cached slots, acquire the global lock and get new cached slots, or start GC (marking or lazy sweeping).
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3842
Diffstat (limited to 'ractor.c')
-rw-r--r--ractor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ractor.c b/ractor.c
index 49a92a2661..64e20b46e7 100644
--- a/ractor.c
+++ b/ractor.c
@@ -1230,6 +1230,7 @@ rb_ractor_main_alloc(void)
r->id = ++ractor_last_id;
r->loc = Qnil;
r->name = Qnil;
+ r->self = Qnil;
ruby_single_main_ractor = r;
return r;
@@ -2154,7 +2155,6 @@ static VALUE
ractor_reset_belonging(VALUE obj)
{
#if RACTOR_CHECK_MODE > 0
- rp(obj);
rb_obj_traverse(obj, reset_belonging_enter, null_leave, NULL);
#endif
return obj;