summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorMatt Valentine-House <matt@eightbitraptor.com>2023-02-17 13:32:51 +0000
committerMatt Valentine-House <matt@eightbitraptor.com>2023-04-06 11:07:16 +0100
commitd91a82850ac337c80807743bc0841369a8a1748c (patch)
tree6895a67099d8e77b3c25db7ee25fdfcc1a3b557a /vm.c
parentb0297feb1f487d466ad1186898b4e36209fcd59e (diff)
downloadruby-d91a82850ac337c80807743bc0841369a8a1748c.tar.gz
Pull the shape tree out of the vm object
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/vm.c b/vm.c
index eb60d3792d..27d57a3b24 100644
--- a/vm.c
+++ b/vm.c
@@ -40,6 +40,7 @@
#include "vm_insnhelper.h"
#include "ractor_core.h"
#include "vm_sync.h"
+#include "shape.h"
#include "builtin.h"
@@ -592,7 +593,7 @@ vm_stat(int argc, VALUE *argv, VALUE self)
SET(constant_cache_invalidations, ruby_vm_constant_cache_invalidations);
SET(constant_cache_misses, ruby_vm_constant_cache_misses);
SET(global_cvar_state, ruby_vm_global_cvar_state);
- SET(next_shape_id, (rb_serial_t)GET_VM()->next_shape_id);
+ SET(next_shape_id, (rb_serial_t)GET_SHAPE_TREE()->next_shape_id);
#undef SET
#if USE_DEBUG_COUNTER
@@ -4023,20 +4024,6 @@ Init_vm_objects(void)
#if EXTSTATIC
vm->static_ext_inits = st_init_strtable();
#endif
-
-#ifdef HAVE_MMAP
- vm->shape_list = (rb_shape_t *)mmap(NULL, rb_size_mul_or_raise(SHAPE_BUFFER_SIZE, sizeof(rb_shape_t), rb_eRuntimeError),
- PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
- if (vm->shape_list == MAP_FAILED) {
- vm->shape_list = 0;
- }
-#else
- vm->shape_list = xcalloc(SHAPE_BUFFER_SIZE, sizeof(rb_shape_t));
-#endif
-
- if (!vm->shape_list) {
- rb_memerror();
- }
}
/* Stub for builtin function when not building YJIT units*/