diff options
author | Peter Zhu <[email protected]> | 2025-06-02 16:31:28 -0400 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2025-06-03 12:04:24 -0400 |
commit | ea8b53a53954c2f34b1093ae2547951ae0e1fe8c () | |
tree | 93bdeae1cb7622eeed5fd59c9fb2e850db99fc0a /include/ruby | |
parent | 5f247416b6b46b6f99c9f5229fab36ba721fd975 (diff) |
Allow pass special constants to the write barrier
Some GC implementations want to always know when an object is written to, even if the written value is a special constant. Checking special constants in rb_obj_written was a micro-optimization that made assumptions about the GC implementation.
Notes: Merged: https://.com/ruby/ruby/pull/13497
-rw-r--r-- | include/ruby/internal/abi.h | 2 | ||||
-rw-r--r-- | include/ruby/internal/gc.h | 4 |
2 files changed, 2 insertions, 4 deletions
@@ -24,7 +24,7 @@ * In released versions of Ruby, this number is not defined since teeny * versions of Ruby should guarantee ABI compatibility. */ -#define RUBY_ABI_VERSION 1 /* Windows does not support weak symbols so ruby_abi_version will not exist * in the shared library. */ @@ -785,9 +785,7 @@ rb_obj_written( RGENGC_LOGGING_OBJ_WRITTEN(a, oldv, b, filename, line); #endif - if (!RB_SPECIAL_CONST_P(b)) { - rb_gc_writebarrier(a, b); - } return a; } |