summaryrefslogtreecommitdiff
path: root/sysdeps/mach
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2014-08-20 21:07:27 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-08-20 21:07:27 +0200
commitf36cd8dcb352f7978e9fceb1b512e08a4e296049 (patch)
tree69b2659c99bd49bbe3e92802c9c79b620021330a /sysdeps/mach
parentf517024dce3e21c525a7b634eab61302d6b99150 (diff)
Fix guard size computation
* pthread/pt-create.c (__pthread_create_internal): On thread creation failure, take guard size into account when deallocating the stack. * sysdeps/mach/pt-thread-terminate.c (__pthread_thread_terminate): Take guard size into account when deallocating the stack.
Diffstat (limited to 'sysdeps/mach')
-rw-r--r--sysdeps/mach/pt-thread-terminate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sysdeps/mach/pt-thread-terminate.c b/sysdeps/mach/pt-thread-terminate.c
index 6672065..cb9e26a 100644
--- a/sysdeps/mach/pt-thread-terminate.c
+++ b/sysdeps/mach/pt-thread-terminate.c
@@ -42,7 +42,9 @@ __pthread_thread_terminate (struct __pthread *thread)
if (thread->stack)
{
stackaddr = thread->stackaddr;
- stacksize = thread->stacksize;
+ stacksize = ((thread->guardsize + __vm_page_size-1)
+ / __vm_page_size) * __vm_page_size
+ + thread->stacksize;
}
else
{