diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-08-20 21:07:27 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-08-20 21:07:27 +0200 |
commit | f36cd8dcb352f7978e9fceb1b512e08a4e296049 (patch) | |
tree | 69b2659c99bd49bbe3e92802c9c79b620021330a /pthread/pt-create.c | |
parent | f517024dce3e21c525a7b634eab61302d6b99150 (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 'pthread/pt-create.c')
-rw-r--r-- | pthread/pt-create.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pthread/pt-create.c b/pthread/pt-create.c index 00884b5..78dd17e 100644 --- a/pthread/pt-create.c +++ b/pthread/pt-create.c @@ -227,7 +227,10 @@ __pthread_create_internal (struct __pthread **thread, goto failed; failed_thread_alloc: if (pthread->stack) - __pthread_stack_dealloc (pthread->stackaddr, pthread->stacksize); + __pthread_stack_dealloc (pthread->stackaddr, + ((setup->guardsize + __vm_page_size-1) + / __vm_page_size) * __vm_page_size + + pthread->stacksize); failed_stack_alloc: __pthread_dealloc (pthread); failed: |