diff options
| author | Jean Boussier <jean.boussier@gmail.com> | 2025-08-07 14:47:37 +0200 |
|---|---|---|
| committer | Jean Boussier <jean.boussier@gmail.com> | 2025-08-07 21:00:00 +0200 |
| commit | 1986d775cdae6a0ab40a2528e2ec9b50e06eba70 (patch) | |
| tree | 0611bb9d506b2e973c3a923c0842b4b95d71bd5b /internal | |
| parent | 5bcfc53d6fa5518a194f2d0771830eb961180991 (diff) | |
symbol.c: use `rb_gc_mark_and_move` over `rb_gc_location`
The `p->field = rb_gc_location(p->field)` isn't ideal because it means all
references are rewritten on compaction, regardless of whether the referenced
object has moved. This isn't good for caches nor for Copy-on-Write.
`rb_gc_mark_and_move` avoid needless writes, and most of the time allow to
have a single function for both marking and updating references.
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/symbol.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/internal/symbol.h b/internal/symbol.h index 8571c00289..b9109b1347 100644 --- a/internal/symbol.h +++ b/internal/symbol.h @@ -17,8 +17,7 @@ #endif /* symbol.c */ -void rb_sym_global_symbols_mark(void); -void rb_sym_global_symbols_update_references(void); +void rb_sym_global_symbols_mark_and_move(void); VALUE rb_to_symbol_type(VALUE obj); VALUE rb_sym_intern(const char *ptr, long len, rb_encoding *enc); VALUE rb_sym_intern_ascii(const char *ptr, long len); |
