summaryrefslogtreecommitdiff
path: root/shape.h
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2023-03-17 11:29:04 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2023-03-20 13:54:18 -0700
commit54dbd8bea8a79bfcdefa471c1717c6cd28022f33 (patch)
treea192755d979ae7db2a47616450d8a32332855809 /shape.h
parent51834ff2ec4fba7fa4d62b04365c1c9c5b6700f1 (diff)
downloadruby-54dbd8bea8a79bfcdefa471c1717c6cd28022f33.tar.gz
Use an st table for "too complex" objects
st tables will maintain insertion order so we can marshal dump / load objects with instance variables in the same order they were set on that particular instance [ruby-core:112926] [Bug #19535] Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
Diffstat (limited to 'shape.h')
-rw-r--r--shape.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/shape.h b/shape.h
index 41d0b1f131..b635ddf8b7 100644
--- a/shape.h
+++ b/shape.h
@@ -156,12 +156,12 @@ ROBJECT_IV_CAPACITY(VALUE obj)
return rb_shape_get_shape_by_id(ROBJECT_SHAPE_ID(obj))->capacity;
}
-static inline struct rb_id_table *
+static inline st_table *
ROBJECT_IV_HASH(VALUE obj)
{
RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT);
RUBY_ASSERT(ROBJECT_SHAPE_ID(obj) == OBJ_TOO_COMPLEX_SHAPE_ID);
- return (struct rb_id_table *)ROBJECT(obj)->as.heap.ivptr;
+ return (st_table *)ROBJECT(obj)->as.heap.ivptr;
}
static inline void
@@ -178,7 +178,7 @@ static inline uint32_t
ROBJECT_IV_COUNT(VALUE obj)
{
if (ROBJECT_SHAPE_ID(obj) == OBJ_TOO_COMPLEX_SHAPE_ID) {
- return (uint32_t)rb_id_table_size(ROBJECT_IV_HASH(obj));
+ return (uint32_t)rb_st_table_size(ROBJECT_IV_HASH(obj));
}
else {
RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT);