aboutsummaryrefslogtreecommitdiffstats
path: root/ractor_core.h
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_core.h
parent1d0bf3d8dd8de40d498a7c2784a84aa566d290b9 (diff)
downloadruby-91d99025e4776885ceea809123a129cb31cd1db6.tar.gz
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).
Diffstat (limited to 'ractor_core.h')
-rw-r--r--ractor_core.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/ractor_core.h b/ractor_core.h
index 9f87f15e55..3f367ad559 100644
--- a/ractor_core.h
+++ b/ractor_core.h
@@ -133,6 +133,11 @@ struct rb_ractor_struct {
VALUE verbose;
VALUE debug;
+ struct {
+ struct RVALUE *freelist;
+ struct heap_page *using_page;
+ } newobj_cache;
+
// gc.c rb_objspace_reachable_objects_from
struct gc_mark_func_data_struct {
void *data;