diff options
author | Alan Wu <[email protected]> | 2023-03-15 13:43:49 -0400 |
---|---|---|
committer | Alan Wu <[email protected]> | 2023-03-15 15:45:20 -0400 |
commit | de174681f7db3cc84ee8c55cafe89bb85a77e945 (patch) | |
tree | 98d3394c448380ee3180e97679de97de11ad9a3a /yjit.c | |
parent | f613c18912f4bf5492a8dc02ab5e3661f4ae907c (diff) |
YJIT: Assert that we have the VM lock while marking
Somewhat important because having the lock is a key part of the
soundness reasoning for the `unsafe` usage here.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7530
Diffstat (limited to 'yjit.c')
-rw-r--r-- | yjit.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1100,6 +1100,14 @@ object_shape_count(rb_execution_context_t *ec, VALUE self) return ULONG2NUM((unsigned long)GET_VM()->next_shape_id); } +// Assert that we have the VM lock. Relevant mostly for multi ractor situations. +// The GC takes the lock before calling us, and this asserts that it indeed happens. +void +rb_yjit_assert_holding_vm_lock(void) +{ + ASSERT_vm_locking(); +} + // Primitives used by yjit.rb VALUE rb_yjit_stats_enabled_p(rb_execution_context_t *ec, VALUE self); VALUE rb_yjit_trace_exit_locations_enabled_p(rb_execution_context_t *ec, VALUE self); |