summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2025-06-02 16:31:28 -0400
committerPeter Zhu <[email protected]>2025-06-03 12:04:24 -0400
commitea8b53a53954c2f34b1093ae2547951ae0e1fe8c (patch)
tree93bdeae1cb7622eeed5fd59c9fb2e850db99fc0a /include/ruby
parent5f247416b6b46b6f99c9f5229fab36ba721fd975 (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
Notes: Merged: https://github.com/ruby/ruby/pull/13497
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/internal/abi.h2
-rw-r--r--include/ruby/internal/gc.h4
2 files changed, 2 insertions, 4 deletions
diff --git a/include/ruby/internal/abi.h b/include/ruby/internal/abi.h
index e6d1fa7e8f..0c99d93bf9 100644
--- a/include/ruby/internal/abi.h
+++ b/include/ruby/internal/abi.h
@@ -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
+#define RUBY_ABI_VERSION 2
/* Windows does not support weak symbols so ruby_abi_version will not exist
* in the shared library. */
diff --git a/include/ruby/internal/gc.h b/include/ruby/internal/gc.h
index 5ab3bb266e..19783f3023 100644
--- a/include/ruby/internal/gc.h
+++ b/include/ruby/internal/gc.h
@@ -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);
- }
+ rb_gc_writebarrier(a, b);
return a;
}