mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* thread_pthread.c (ruby_init_stack): prior STACK_END_ADDRESS if
found. [ruby-core:17624] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2754e843b6
commit
fc5746681e
2 changed files with 13 additions and 0 deletions
|
@ -179,6 +179,10 @@ static struct {
|
|||
#endif
|
||||
} native_main_thread;
|
||||
|
||||
#ifdef STACK_END_ADDRESS
|
||||
extern void *STACK_END_ADDRESS;
|
||||
#endif
|
||||
|
||||
#undef ruby_init_stack
|
||||
void
|
||||
ruby_init_stack(VALUE *addr
|
||||
|
@ -188,12 +192,16 @@ ruby_init_stack(VALUE *addr
|
|||
)
|
||||
{
|
||||
native_main_thread.id = pthread_self();
|
||||
#ifdef STACK_END_ADDRESS
|
||||
native_main_thread.stack_start = STACK_END_ADDRESS;
|
||||
#else
|
||||
if (!native_main_thread.stack_start ||
|
||||
STACK_UPPER(&addr,
|
||||
native_main_thread.stack_start > addr,
|
||||
native_main_thread.stack_start < addr)) {
|
||||
native_main_thread.stack_start = addr;
|
||||
}
|
||||
#endif
|
||||
#ifdef __ia64
|
||||
if (!native_main_thread.register_stack_start ||
|
||||
(VALUE*)bsp < native_main_thread.register_stack_start) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue