diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-07 12:23:15 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-07 12:23:15 +0000 |
commit | df6ea23faff164bae0557ea551da0dfb549e8b1b (patch) | |
tree | 7f710de7eb8bf95f0d04a0bb9c87261fadb29d9b /thread_win32.c | |
parent | 4faa9ea612ce99455d2294dc0b4f02cacc5d4f33 (diff) | |
download | ruby-df6ea23faff164bae0557ea551da0dfb549e8b1b.tar.gz |
* thread_win32.c (thread_start_func_1): use already gotten stack info.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_win32.c')
-rw-r--r-- | thread_win32.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/thread_win32.c b/thread_win32.c index 5d6bf9e4bf..feba5ecfcc 100644 --- a/thread_win32.c +++ b/thread_win32.c @@ -451,26 +451,10 @@ native_thread_destroy(rb_thread_t *th) w32_close_handle(intr); } -static void * -get_stack_info(const void *ptr, size_t *maxsize) -{ - MEMORY_BASIC_INFORMATION mi; - DWORD size; - DWORD space; - - if (!VirtualQuery(ptr, &mi, sizeof(mi))) return 0; - size = (char *)mi.BaseAddress - (char *)mi.AllocationBase; - space = size / 5; - if (space > 1024*1024) space = 1024*1024; - *maxsize = size - space; - return (VALUE *)mi.BaseAddress - 1; -} - static unsigned long _stdcall thread_start_func_1(void *th_ptr) { rb_thread_t *th = th_ptr; - VALUE *stack_start; volatile HANDLE thread_id = th->thread_id; native_thread_init_stack(th); @@ -480,8 +464,7 @@ thread_start_func_1(void *th_ptr) thread_debug("thread created (th: %p, thid: %p, event: %p)\n", th, th->thread_id, th->native_thread_data.interrupt_event); - stack_start = get_stack_info(&stack_start, &th->machine_stack_maxsize); - thread_start_func_2(th, stack_start, rb_ia64_bsp()); + thread_start_func_2(th, th->machine_stack_start, rb_ia64_bsp()); w32_close_handle(thread_id); thread_debug("thread deleted (th: %p)\n", th); |