summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2023-07-22 13:24:55 +0900
committernagachika <nagachika@ruby-lang.org>2023-07-22 13:24:55 +0900
commitfa72ba72f8c64fd0fa87c8f68cbc31f2e7b94b00 (patch)
tree62fd2b19b7b85f0fbd30a1537a250650529d15a2 /include/ruby
parenta3911b965f094f07080cf7adb22ee5e2e8555d86 (diff)
merge revision(s) 54dbd8bea8a79bfcdefa471c1717c6cd28022f33: [Backport #19535]
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> --- gc.c | 10 ++++------ include/ruby/st.h | 2 ++ object.c | 2 +- ractor.c | 43 ++++++++++++++++++++++--------------------- shape.h | 6 +++--- st.c | 6 ++++++ test/ruby/test_shapes.rb | 21 +++++++++++++++++++++ variable.c | 28 ++++++++++++++-------------- vm_insnhelper.c | 2 +- 9 files changed, 74 insertions(+), 46 deletions(-)
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/st.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/ruby/st.h b/include/ruby/st.h
index 1e4bb80686..f35ab43603 100644
--- a/include/ruby/st.h
+++ b/include/ruby/st.h
@@ -98,6 +98,8 @@ struct st_table {
enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK, ST_REPLACE};
+size_t rb_st_table_size(const struct st_table *tbl);
+#define st_table_size rb_st_table_size
st_table *rb_st_init_table(const struct st_hash_type *);
#define st_init_table rb_st_init_table
st_table *rb_st_init_table_with_size(const struct st_hash_type *, st_index_t);