From f8b3123eb9915562d4b6a9e50a8e93f547b59ae4 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 30 Aug 2013 01:26:05 +0000 Subject: [PATCH] thread_pthread.c: fix vps_pagesize * thread_pthread.c (hpux_attr_getstackaddr): vps_pagesize is defaulted to 16 and in Kbytes. [ruby-core:56863] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_pthread.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/thread_pthread.c b/thread_pthread.c index 0cb5489f49..1e6b80ae49 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -518,16 +518,17 @@ size_t pthread_get_stacksize_np(pthread_t); * The vps_pagesize is 'Default user page size (kBytes)' * and could be retrieved by gettune(). */ - -static int hpux_attr_getstackaddr(const pthread_attr_t *attr, void *addr) +static int +hpux_attr_getstackaddr(const pthread_attr_t *attr, void *addr) { static uint64_t pagesize; size_t size; if (!pagesize) { if (gettune("vps_pagesize", &pagesize)) { - pagesize = 1024; + pagesize = 16; } + pagesize *= 1024; } pthread_attr_getstacksize(attr, &size); *addr = (void *)((size_t)((char *)_Asm_get_sp() - size) & ~(pagesize - 1));