Lines Matching refs:size
60 size_t size = *sizep; in get_cached_stack() local
77 if (__nptl_stack_in_use (curr) && curr->stackblock_size >= size) in get_cached_stack()
79 if (curr->stackblock_size == size) in get_cached_stack()
94 || __builtin_expect (result->stackblock_size > 4 * size, 0)) in get_cached_stack()
148 guard_position (void *mem, size_t size, size_t guardsize, struct pthread *pd, in guard_position() argument
152 return mem + (((size - guardsize) / 2) & ~pagesize_m1); in guard_position()
163 setup_stack_prot (char *mem, size_t size, char *guard, size_t guardsize, in setup_stack_prot() argument
170 if (__mprotect (guardend, size - guardsize, prot) != 0) in setup_stack_prot()
176 size_t mprots2 = ((uintptr_t) mem + size) - (uintptr_t) guardend; in setup_stack_prot()
186 advise_stack_range (void *mem, size_t size, uintptr_t pd, size_t guardsize) in advise_stack_range() argument
192 assert (freesize < size); in advise_stack_range()
203 assert (freesize < size); in advise_stack_range()
218 size_t size; in allocate_stack() local
229 size = attr->stacksize; in allocate_stack()
233 size = __default_pthread_attr.internal.stacksize; in allocate_stack()
260 assert (size > adj + TLS_TCB_SIZE); in allocate_stack()
264 assert (size > adj); in allocate_stack()
287 pd->stackblock = (char *) stackaddr - size; in allocate_stack()
288 pd->stackblock_size = size; in allocate_stack()
332 size &= ~tls_static_align_m1; in allocate_stack()
333 assert (size != 0); in allocate_stack()
347 if (guardsize < attr->guardsize || size + guardsize < guardsize) in allocate_stack()
350 size += guardsize; in allocate_stack()
351 if (__builtin_expect (size < ((guardsize + tls_static_size_for_stack in allocate_stack()
359 reqsize = size; in allocate_stack()
360 pd = get_cached_stack (&size, &mem); in allocate_stack()
366 mem = __mmap (NULL, size, (guardsize == 0) ? prot : PROT_NONE, in allocate_stack()
378 pd = (struct pthread *) ((((uintptr_t) mem + size) in allocate_stack()
382 pd = (struct pthread *) ((((uintptr_t) mem + size in allocate_stack()
391 char *guard = guard_position (mem, size, guardsize, pd, in allocate_stack()
393 if (setup_stack_prot (mem, size, guard, guardsize, prot) != 0) in allocate_stack()
395 __munmap (mem, size); in allocate_stack()
402 pd->stackblock_size = size; in allocate_stack()
429 (void) __munmap (mem, size); in allocate_stack()
455 (void) __munmap (mem, size); in allocate_stack()
473 char *guard = guard_position (mem, size, guardsize, pd, in allocate_stack()
493 (void) __munmap (mem, size); in allocate_stack()
500 else if (__builtin_expect (pd->guardsize - guardsize > size - reqsize, in allocate_stack()
506 char *guard = mem + (((size - guardsize) / 2) & ~pagesize_m1); in allocate_stack()
507 char *oldguard = mem + (((size - pd->guardsize) / 2) & ~pagesize_m1); in allocate_stack()