Lines Matching refs:stack

24 ZEND_API void zend_ptr_stack_init_ex(zend_ptr_stack *stack, bool persistent)  in zend_ptr_stack_init_ex()  argument
26 stack->top_element = stack->elements = NULL; in zend_ptr_stack_init_ex()
27 stack->top = stack->max = 0; in zend_ptr_stack_init_ex()
28 stack->persistent = persistent; in zend_ptr_stack_init_ex()
31 ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack) in zend_ptr_stack_init() argument
33 zend_ptr_stack_init_ex(stack, 0); in zend_ptr_stack_init()
37 ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...) in zend_ptr_stack_n_push() argument
42 ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count) in zend_ptr_stack_n_push()
47 stack->top++; in zend_ptr_stack_n_push()
48 *(stack->top_element++) = elem; in zend_ptr_stack_n_push()
55 ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...) in zend_ptr_stack_n_pop() argument
63 *elem = *(--stack->top_element); in zend_ptr_stack_n_pop()
64 stack->top--; in zend_ptr_stack_n_pop()
72 ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack) in zend_ptr_stack_destroy() argument
74 if (stack->elements) { in zend_ptr_stack_destroy()
75 pefree(stack->elements, stack->persistent); in zend_ptr_stack_destroy()
80 ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *)) in zend_ptr_stack_apply() argument
82 int i = stack->top; in zend_ptr_stack_apply()
85 func(stack->elements[i]); in zend_ptr_stack_apply()
89 ZEND_API void zend_ptr_stack_reverse_apply(zend_ptr_stack *stack, void (*func)(void *)) in zend_ptr_stack_reverse_apply() argument
93 while (i < stack->top) { in zend_ptr_stack_reverse_apply()
94 func(stack->elements[i++]); in zend_ptr_stack_reverse_apply()
99 ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), bool free_elements) in zend_ptr_stack_clean() argument
101 zend_ptr_stack_apply(stack, func); in zend_ptr_stack_clean()
103 int i = stack->top; in zend_ptr_stack_clean()
106 pefree(stack->elements[i], stack->persistent); in zend_ptr_stack_clean()
109 stack->top = 0; in zend_ptr_stack_clean()
110 stack->top_element = stack->elements; in zend_ptr_stack_clean()
114 ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack) in zend_ptr_stack_num_elements() argument
116 return stack->top; in zend_ptr_stack_num_elements()