Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thread_pthread: Grow main_stack if required (fixes tests on HPPA) #7676

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 14 additions & 2 deletions thread_pthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,20 @@ size_t pthread_get_stacksize_np(pthread_t);
# define MAINSTACKADDR_AVAILABLE 0
# endif
#endif
#if MAINSTACKADDR_AVAILABLE && !defined(get_main_stack)
# define get_main_stack(addr, size) get_stack(addr, size)
#if MAINSTACKADDR_AVAILABLE
static int get_stack(void **, size_t *);
static int
get_main_stack(void **addr, size_t *size)
{
int ret = get_stack(addr, size);

/* On some architectures, the initial stack size may be too small, but fortunately,
it's growable. Bump it up to the minimum needed if it is too small. */
if (*size < RUBY_VM_THREAD_VM_STACK_SIZE)
*size = RUBY_VM_THREAD_VM_STACK_SIZE;

return ret;
}
#endif

#ifdef STACKADDR_AVAILABLE
Expand Down