pthread_getattr_np(pthread_self(), &attr);
pthread_attr_getstack(&attr, &addr, &size);
pthread_attr_destroy(&attr);
- return addr + size;
+ version (StackGrowsDown)
+ addr += size;
+ return addr;
}
else version (FreeBSD)
{
pthread_attr_get_np(pthread_self(), &attr);
pthread_attr_getstack(&attr, &addr, &size);
pthread_attr_destroy(&attr);
- return addr + size;
+ version (StackGrowsDown)
+ addr += size;
+ return addr;
}
else version (NetBSD)
{
pthread_attr_get_np(pthread_self(), &attr);
pthread_attr_getstack(&attr, &addr, &size);
pthread_attr_destroy(&attr);
- return addr + size;
+ version (StackGrowsDown)
+ addr += size;
+ return addr;
}
else version (Solaris)
{
pthread_getattr_np(pthread_self(), &attr);
pthread_attr_getstack(&attr, &addr, &size);
pthread_attr_destroy(&attr);
- return addr + size;
+ version (StackGrowsDown)
+ addr += size;
+ return addr;
}
else
static assert(false, "Platform not supported.");
//debug = INVARIANT; // enable invariants
//debug = PROFILE_API; // profile API calls for config.profile > 1
-/*************** Configuration *********************/
-
-version = STACKGROWSDOWN; // growing the stack means subtracting from the stack pointer
- // (use for Intel X86 CPUs)
- // else growing the stack means adding to the stack pointer
-
/***************************************************/
import gc.bits;