aboutsummaryrefslogtreecommitdiffstats
path: root/internal
diff options
context:
space:
mode:
authorMatt Valentine-House <matt@eightbitraptor.com>2023-08-31 15:35:56 +0100
committerMatt Valentine-House <matt@eightbitraptor.com>2023-08-31 19:31:18 +0100
commit322548180d01ce99dcb8ecb3c36f2a9261554657 (patch)
treed8d5df55533cce301eecffd60a2a6f070a52bad4 /internal
parent84fa8ae84eeb20a35ff2040dbf107c6d9babfdec (diff)
downloadruby-322548180d01ce99dcb8ecb3c36f2a9261554657.tar.gz
Prevent rb_gc_mark_values from pinning objects
This is an internal only function not exposed to the C extension API. It's only use so far is from rb_vm_mark, where it's used to mark the values in the vm->trap_list.cmd array. There shouldn't be any reason why these cannot move. This commit allows them to move by updating their references during the reference updating step of compaction. To do this we've introduced another internal function rb_gc_update_values as a partner to rb_gc_mark_values. This allows us to refactor rb_gc_mark_values to not pin
Diffstat (limited to 'internal')
-rw-r--r--internal/gc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/gc.h b/internal/gc.h
index 7e0942a76a..be40a7a2f7 100644
--- a/internal/gc.h
+++ b/internal/gc.h
@@ -274,6 +274,7 @@ void rb_gc_verify_internal_consistency(void);
size_t rb_obj_gc_flags(VALUE, ID[], size_t);
void rb_gc_mark_values(long n, const VALUE *values);
void rb_gc_mark_vm_stack_values(long n, const VALUE *values);
+void rb_gc_update_values(long n, VALUE *values);
void *ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2));
void *ruby_sized_xrealloc2(void *ptr, size_t new_count, size_t element_size, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2, 3));
void ruby_sized_xfree(void *x, size_t size);