From 54dbd8bea8a79bfcdefa471c1717c6cd28022f33 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 17 Mar 2023 11:29:04 -0700 Subject: 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 --- st.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'st.c') diff --git a/st.c b/st.c index b18b9d6cb9..411237d13b 100644 --- a/st.c +++ b/st.c @@ -569,6 +569,12 @@ st_init_table_with_size(const struct st_hash_type *type, st_index_t size) return tab; } +size_t +st_table_size(const struct st_table *tbl) +{ + return tbl->num_entries; +} + /* Create and return table with TYPE which can hold a minimal number of entries (see comments for get_power2). */ st_table * -- cgit v1.2.3