Lines Matching refs:stack
58 bool zend_fiber_stack_allocate(zend_fiber_stack *stack, size_t size) in zend_fiber_stack_allocate() argument
65 stack->size = (size + page_size - 1) / page_size * page_size; in zend_fiber_stack_allocate()
66 const size_t msize = stack->size + ZEND_FIBER_GUARD_PAGES * page_size; in zend_fiber_stack_allocate()
98 stack->pointer = (void *) ((uintptr_t) pointer + ZEND_FIBER_GUARD_PAGES * page_size); in zend_fiber_stack_allocate()
101 uintptr_t base = (uintptr_t) stack->pointer; in zend_fiber_stack_allocate()
102 stack->valgrind = VALGRIND_STACK_REGISTER(base, base + stack->size); in zend_fiber_stack_allocate()
108 void zend_fiber_stack_free(zend_fiber_stack *stack) in zend_fiber_stack_free() argument
110 if (!stack->pointer) { in zend_fiber_stack_free()
115 VALGRIND_STACK_DEREGISTER(stack->valgrind); in zend_fiber_stack_free()
120 void *pointer = (void *) ((uintptr_t) stack->pointer - ZEND_FIBER_GUARD_PAGES * page_size); in zend_fiber_stack_free()
125 munmap(pointer, stack->size + ZEND_FIBER_GUARD_PAGES * page_size); in zend_fiber_stack_free()
128 stack->pointer = NULL; in zend_fiber_stack_free()