summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-09 05:15:57 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-09 05:15:57 (GMT)
commitf7ab09063563af0fca366ba39e7ff21b5231b005 (patch)
tree0c4ebeef53dc34427a3d00f2f89f91bf9dcf0cf4 /string.c
parentef53976662096a955acb0317ac3a12ad18921ee8 (diff)
vm.c: frozen_strings in rb_vm_t
* vm.c (Init_vm_objects, rb_vm_fstring_table): use frozen_strings table in rb_vm_t. [ruby-core:70274] [Bug #11423] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/string.c b/string.c
index 9979997..57ab6da 100644
--- a/string.c
+++ b/string.c
@@ -216,17 +216,11 @@ mustnot_wchar(VALUE str)
static int fstring_cmp(VALUE a, VALUE b);
-/* in case we restart MVM development, this needs to be per-VM */
-static st_table* frozen_strings;
static VALUE register_fstring(VALUE str);
-static inline st_table*
-rb_vm_fstring_table(void)
-{
- return frozen_strings;
-}
+st_table *rb_vm_fstring_table(void);
-static const struct st_hash_type fstring_hash_type = {
+const struct st_hash_type rb_fstring_hash_type = {
fstring_cmp,
rb_str_hash,
};
@@ -308,10 +302,11 @@ static VALUE
register_fstring(VALUE str)
{
VALUE ret;
+ st_table *frozen_strings = rb_vm_fstring_table();
do {
ret = str;
- st_update(rb_vm_fstring_table(), (st_data_t)str,
+ st_update(frozen_strings, (st_data_t)str,
fstr_update_callback, (st_data_t)&ret);
} while (ret == Qundef);
@@ -9327,10 +9322,3 @@ Init_String(void)
assert(rb_vm_fstring_table());
st_foreach(rb_vm_fstring_table(), fstring_set_class_i, rb_cString);
}
-
-void
-Init_frozen_strings(void)
-{
- assert(!frozen_strings);
- frozen_strings = st_init_table_with_size(&fstring_hash_type, 1000);
-}