Lines Matching refs:stack

34 ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack);
35 ZEND_API void zend_ptr_stack_init_ex(zend_ptr_stack *stack, bool persistent);
36 ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...);
37 ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...);
38 ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack);
39 ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *));
40 ZEND_API void zend_ptr_stack_reverse_apply(zend_ptr_stack *stack, void (*func)(void *));
41 ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), bool free_elements);
42 ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack);
45 #define ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count) \ in END_EXTERN_C() argument
46 if (stack->top+count > stack->max) { \ in END_EXTERN_C()
49 stack->max += PTR_STACK_BLOCK_SIZE; \ in END_EXTERN_C()
50 } while (stack->top+count > stack->max); \ in END_EXTERN_C()
51stack->elements = (void **) safe_perealloc(stack->elements, sizeof(void *), (stack->max), 0, stack in END_EXTERN_C()
52 stack->top_element = stack->elements+stack->top; \ in END_EXTERN_C()
57 static zend_always_inline void zend_ptr_stack_3_push(zend_ptr_stack *stack, void *a, void *b, void …
61 ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, ZEND_PTR_STACK_NUM_ARGS)
63 stack->top += ZEND_PTR_STACK_NUM_ARGS;
64 *(stack->top_element++) = a;
65 *(stack->top_element++) = b;
66 *(stack->top_element++) = c;
71 static zend_always_inline void zend_ptr_stack_2_push(zend_ptr_stack *stack, void *a, void *b) in zend_ptr_stack_2_push() argument
75 ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, ZEND_PTR_STACK_NUM_ARGS) in zend_ptr_stack_2_push()
77 stack->top += ZEND_PTR_STACK_NUM_ARGS; in zend_ptr_stack_2_push()
78 *(stack->top_element++) = a; in zend_ptr_stack_2_push()
79 *(stack->top_element++) = b; in zend_ptr_stack_2_push()
84 static zend_always_inline void zend_ptr_stack_3_pop(zend_ptr_stack *stack, void **a, void **b, void… in zend_ptr_stack_3_pop() argument
86 *a = *(--stack->top_element); in zend_ptr_stack_3_pop()
87 *b = *(--stack->top_element); in zend_ptr_stack_3_pop()
88 *c = *(--stack->top_element); in zend_ptr_stack_3_pop()
89 stack->top -= 3; in zend_ptr_stack_3_pop()
92 static zend_always_inline void zend_ptr_stack_2_pop(zend_ptr_stack *stack, void **a, void **b) in zend_ptr_stack_2_pop() argument
94 *a = *(--stack->top_element); in zend_ptr_stack_2_pop()
95 *b = *(--stack->top_element); in zend_ptr_stack_2_pop()
96 stack->top -= 2; in zend_ptr_stack_2_pop()
99 static zend_always_inline void zend_ptr_stack_push(zend_ptr_stack *stack, void *ptr) in zend_ptr_stack_push() argument
101 ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, 1) in zend_ptr_stack_push()
103 stack->top++; in zend_ptr_stack_push()
104 *(stack->top_element++) = ptr; in zend_ptr_stack_push()
107 static zend_always_inline void *zend_ptr_stack_pop(zend_ptr_stack *stack) in zend_ptr_stack_pop() argument
109 stack->top--; in zend_ptr_stack_pop()
110 return *(--stack->top_element); in zend_ptr_stack_pop()
113 static zend_always_inline void *zend_ptr_stack_top(zend_ptr_stack *stack) in zend_ptr_stack_top() argument
115 return stack->elements[stack->top - 1]; in zend_ptr_stack_top()