summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-27 01:56:38 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-27 01:56:38 (GMT)
commit9c6deac2d1ea29002f4af33b9c1c15aa2d4c34b7 (patch)
tree27c26fc0361f7fd62cfdc5c8520f315bb78f7527 /vm.c
parent969057c95a4d8c26cf58dd99dff3dbface11f1cd (diff)
* vm_core.h: add rb_thread_t::local_storage_recursive_hash
to speed up Thread#[:__recursive_key__] access. [Bug #10511] * thread.c (threadptr_local_aref): add fast path for :__recursive_data__. * thread.c (threadptr_recursive_hash, threadptr_recursive_hash_set): add special accessor for recursive hash. * cont.c: store/restore local_storage_recursive_hash. * vm.c: init and mark local_storage_recursive_hash. * vm_trace.c (rb_threadptr_exec_event_hooks_orig): clear and restore local_storage_recursive_hash directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index ddb93f60..4800211 100644
--- a/vm.c
+++ b/vm.c
@@ -2062,6 +2062,7 @@ rb_thread_mark(void *ptr)
RUBY_MARK_UNLESS_NULL(th->locking_mutex);
rb_mark_tbl(th->local_storage);
+ RUBY_MARK_UNLESS_NULL(th->local_storage_recursive_hash);
if (GET_THREAD() != th && th->machine.stack_start && th->machine.stack_end) {
rb_gc_mark_machine_stack(th);
@@ -2195,6 +2196,7 @@ th_init(rb_thread_t *th, VALUE self)
th->last_status = Qnil;
th->waiting_fd = -1;
th->root_svar = Qnil;
+ th->local_storage_recursive_hash = Qnil;
#ifdef NON_SCALAR_THREAD_ID
th->thread_id_string[0] = '\0';
#endif