20#ifndef ZEND_PTR_STACK_H
21#define ZEND_PTR_STACK_H
33#define PTR_STACK_BLOCK_SIZE 64
47#define ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count) \
48 if (stack->top+count > stack->max) { \
51 stack->max += PTR_STACK_BLOCK_SIZE; \
52 } while (stack->top+count > stack->max); \
53 stack->elements = (void **) safe_perealloc(stack->elements, sizeof(void *), (stack->max), 0, stack->persistent); \
54 stack->top_element = stack->elements+stack->top; \
61#define ZEND_PTR_STACK_NUM_ARGS 3
70#undef ZEND_PTR_STACK_NUM_ARGS
75#define ZEND_PTR_STACK_NUM_ARGS 2
83#undef ZEND_PTR_STACK_NUM_ARGS
106 *(stack->top_element++) =
ptr;
112 return *(--stack->top_element);
count(Countable|array $value, int $mode=COUNT_NORMAL)
#define zend_always_inline
ZEND_API void zend_ptr_stack_reverse_apply(zend_ptr_stack *stack, void(*func)(void *))
ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count,...)
ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void(*func)(void *), bool free_elements)
ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack)
ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack)
ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack)
ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void(*func)(void *))
ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count,...)
ZEND_API void zend_ptr_stack_init_ex(zend_ptr_stack *stack, bool persistent)
#define ZEND_PTR_STACK_NUM_ARGS
struct _zend_ptr_stack zend_ptr_stack
#define ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count)