summaryrefslogtreecommitdiff
path: root/vm.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 /vm.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 'vm.c')
-rw-r--r--vm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index 1095614..4245ea4 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))