зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
5da55dfcb4
Коммит
f8b3123eb9
|
@ -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));
|
||||
|
|
Загрузка…
Ссылка в новой задаче