diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-28 06:09:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-28 06:09:58 +0000 |
commit | 628f75b7524c8cd10bb2760c62d2311dbfeed70d (patch) | |
tree | 888a11126a5ec963e8902b5a6a197917160d6688 /thread_pthread.c | |
parent | d248a2c96eb50df5b562a5da45d4b2fb05500854 (diff) |
vm_core.h: rb_thread_struct::machine
* vm_core.h (rb_thread_struct): aggregate cpu stuff into a struct,
so that a debugger can show its content at once.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/thread_pthread.c b/thread_pthread.c index 257911cdd0..b998083dca 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -749,8 +749,8 @@ native_thread_init_stack(rb_thread_t *th) rb_nativethread_id_t curr = pthread_self(); if (pthread_equal(curr, native_main_thread.id)) { - th->machine_stack_start = native_main_thread.stack_start; - th->machine_stack_maxsize = native_main_thread.stack_maxsize; + th->machine.stack_start = native_main_thread.stack_start; + th->machine.stack_maxsize = native_main_thread.stack_maxsize; } else { #ifdef STACKADDR_AVAILABLE @@ -758,11 +758,11 @@ native_thread_init_stack(rb_thread_t *th) size_t size; if (get_stack(&start, &size) == 0) { - th->machine_stack_start = start; - th->machine_stack_maxsize = size; + th->machine.stack_start = start; + th->machine.stack_maxsize = size; } #elif defined get_stack_of - if (!th->machine_stack_maxsize) { + if (!th->machine.stack_maxsize) { native_mutex_lock(&th->interrupt_lock); native_mutex_unlock(&th->interrupt_lock); } @@ -771,9 +771,9 @@ native_thread_init_stack(rb_thread_t *th) #endif } #ifdef __ia64 - th->machine_register_stack_start = native_main_thread.register_stack_start; - th->machine_stack_maxsize /= 2; - th->machine_register_stack_maxsize = th->machine_stack_maxsize; + th->machine.register_stack_start = native_main_thread.register_stack_start; + th->machine.stack_maxsize /= 2; + th->machine.register_stack_maxsize = th->machine.stack_maxsize; #endif return 0; } @@ -800,7 +800,7 @@ thread_start_func_1(void *th_ptr) native_thread_init(th); /* run */ #if defined USE_NATIVE_THREAD_INIT - thread_start_func_2(th, th->machine_stack_start, rb_ia64_bsp()); + thread_start_func_2(th, th->machine.stack_start, rb_ia64_bsp()); #else thread_start_func_2(th, &stack_start, rb_ia64_bsp()); #endif @@ -922,10 +922,10 @@ native_thread_create(rb_thread_t *th) const size_t stack_size = th->vm->default_params.thread_machine_stack_size; const size_t space = space_size(stack_size); - th->machine_stack_maxsize = stack_size - space; + th->machine.stack_maxsize = stack_size - space; #ifdef __ia64 - th->machine_stack_maxsize /= 2; - th->machine_register_stack_maxsize = th->machine_stack_maxsize; + th->machine.stack_maxsize /= 2; + th->machine.register_stack_maxsize = th->machine.stack_maxsize; #endif #ifdef HAVE_PTHREAD_ATTR_INIT @@ -948,8 +948,8 @@ native_thread_create(rb_thread_t *th) #ifdef get_stack_of if (!err) { get_stack_of(th->thread_id, - &th->machine_stack_start, - &th->machine_stack_maxsize); + &th->machine.stack_start, + &th->machine.stack_maxsize); } native_mutex_unlock(&th->interrupt_lock); #endif @@ -1561,7 +1561,7 @@ ruby_stack_overflowed_p(const rb_thread_t *th, const void *addr) STACK_GROW_DIR_DETECTION; if (th) { - size = th->machine_stack_maxsize; + size = th->machine.stack_maxsize; #if defined(HAVE_GETRLIMIT) && MAINSTACKADDR_AVAILABLE if (pthread_equal(th->thread_id, native_main_thread.id)) { struct rlimit rlim; @@ -1570,7 +1570,7 @@ ruby_stack_overflowed_p(const rb_thread_t *th, const void *addr) } } #endif - base = (char *)th->machine_stack_start - STACK_DIR_UPPER(0, size); + base = (char *)th->machine.stack_start - STACK_DIR_UPPER(0, size); } #ifdef STACKADDR_AVAILABLE else if (get_stack(&base, &size) == 0) { |