Lines Matching refs:stack

36 ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack);
37 ZEND_API void zend_ptr_stack_init_ex(zend_ptr_stack *stack, zend_bool persistent);
38 ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...);
39 ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...);
40 ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack);
41 ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *));
42 ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elem…
43 ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack);
46 #define ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count) \ in END_EXTERN_C() argument
47 if (stack->top+count > stack->max) { \ in END_EXTERN_C()
50 stack->max += PTR_STACK_BLOCK_SIZE; \ in END_EXTERN_C()
51 } while (stack->top+count > stack->max); \ in END_EXTERN_C()
52stack->elements = (void **) perealloc(stack->elements, (sizeof(void *) * (stack->max)), stack->per… in END_EXTERN_C()
53 stack->top_element = stack->elements+stack->top; \ in END_EXTERN_C()
58 static zend_always_inline void zend_ptr_stack_3_push(zend_ptr_stack *stack, void *a, void *b, void …
62 ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, ZEND_PTR_STACK_NUM_ARGS)
64 stack->top += ZEND_PTR_STACK_NUM_ARGS;
65 *(stack->top_element++) = a;
66 *(stack->top_element++) = b;
67 *(stack->top_element++) = c;
72 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
76 ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, ZEND_PTR_STACK_NUM_ARGS) in zend_ptr_stack_2_push()
78 stack->top += ZEND_PTR_STACK_NUM_ARGS; in zend_ptr_stack_2_push()
79 *(stack->top_element++) = a; in zend_ptr_stack_2_push()
80 *(stack->top_element++) = b; in zend_ptr_stack_2_push()
85 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
87 *a = *(--stack->top_element); in zend_ptr_stack_3_pop()
88 *b = *(--stack->top_element); in zend_ptr_stack_3_pop()
89 *c = *(--stack->top_element); in zend_ptr_stack_3_pop()
90 stack->top -= 3; in zend_ptr_stack_3_pop()
93 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
95 *a = *(--stack->top_element); in zend_ptr_stack_2_pop()
96 *b = *(--stack->top_element); in zend_ptr_stack_2_pop()
97 stack->top -= 2; in zend_ptr_stack_2_pop()
100 static zend_always_inline void zend_ptr_stack_push(zend_ptr_stack *stack, void *ptr) in zend_ptr_stack_push() argument
102 ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, 1) in zend_ptr_stack_push()
104 stack->top++; in zend_ptr_stack_push()
105 *(stack->top_element++) = ptr; in zend_ptr_stack_push()
108 static zend_always_inline void *zend_ptr_stack_pop(zend_ptr_stack *stack) in zend_ptr_stack_pop() argument
110 stack->top--; in zend_ptr_stack_pop()
111 return *(--stack->top_element); in zend_ptr_stack_pop()
114 static inline void *zend_ptr_stack_top(zend_ptr_stack *stack) in zend_ptr_stack_top() argument
116 return stack->elements[stack->top - 1]; in zend_ptr_stack_top()