aboutsummaryrefslogtreecommitdiffstats
path: root/vm.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-09 05:15:57 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-09 05:15:57 +0000
commitdb3e9fa40b1339f29885928088f2c88c3876affa (patch)
tree0c4ebeef53dc34427a3d00f2f89f91bf9dcf0cf4 /vm.c
parent29f9986c3f64d1427d7ecb0ac97a328728c5a1a8 (diff)
downloadruby-db3e9fa40b1339f29885928088f2c88c3876affa.tar.gz
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 'vm.c')
-rw-r--r--vm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index 1095614851..4245ea4fb0 100644
--- a/vm.c
+++ b/vm.c
@@ -2786,6 +2786,8 @@ rb_vm_set_progname(VALUE filename)
struct rb_objspace *rb_objspace_alloc(void);
#endif
+extern const struct st_hash_type rb_fstring_hash_type;
+
void
Init_BareVM(void)
{
@@ -2821,6 +2823,7 @@ Init_vm_objects(void)
/* initialize mark object array, hash */
vm->mark_object_ary = rb_ary_tmp_new(128);
vm->loading_table = st_init_strtable();
+ vm->frozen_strings = st_init_table_with_size(&rb_fstring_hash_type, 1000);
}
/* top self */
@@ -2876,6 +2879,12 @@ VALUE rb_insn_operand_intern(const rb_iseq_t *iseq,
VALUE insn, int op_no, VALUE op,
int len, size_t pos, VALUE *pnop, VALUE child);
+st_table *
+rb_vm_fstring_table(void)
+{
+ return GET_VM()->frozen_strings;
+}
+
#if VM_COLLECT_USAGE_DETAILS
#define HASH_ASET(h, k, v) rb_hash_aset((h), (st_data_t)(k), (st_data_t)(v))