[前][次][番号順一覧][スレッド一覧]

ruby-changes:8597

From: nobu <ko1@a...>
Date: Fri, 7 Nov 2008 21:23:29 +0900 (JST)
Subject: [ruby-changes:8597] Ruby:r20132 (trunk): * thread_win32.c (thread_start_func_1): use already gotten stack info.

nobu	2008-11-07 21:23:15 +0900 (Fri, 07 Nov 2008)

  New Revision: 20132

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20132

  Log:
    * thread_win32.c (thread_start_func_1): use already gotten stack info.

  Modified files:
    trunk/ChangeLog
    trunk/thread_win32.c

Index: thread_win32.c
===================================================================
--- thread_win32.c	(revision 20131)
+++ thread_win32.c	(revision 20132)
@@ -451,26 +451,10 @@
     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_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);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 20131)
+++ ChangeLog	(revision 20132)
@@ -1,3 +1,7 @@
+Fri Nov  7 21:23:02 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* thread_win32.c (thread_start_func_1): use already gotten stack info.
+
 Fri Nov  7 12:26:00 2008  Yukihiro Matsumoto  <matz@r...>
 
 	* lib/irb.rb (IRB::Irb#eval_input): remove extra  @context.prompt_i.

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]