Lines Matching refs:stack
40 static inline int zend_worklist_stack_prepare(zend_arena **arena, zend_worklist_stack *stack, int l… in zend_worklist_stack_prepare() argument
44 stack->buf = (int*)zend_arena_calloc(arena, sizeof(*stack->buf), len); in zend_worklist_stack_prepare()
45 stack->len = 0; in zend_worklist_stack_prepare()
46 stack->capacity = len; in zend_worklist_stack_prepare()
51 static inline void zend_worklist_stack_push(zend_worklist_stack *stack, int i) in zend_worklist_stack_push() argument
53 ZEND_ASSERT(stack->len < stack->capacity); in zend_worklist_stack_push()
54 stack->buf[stack->len++] = i; in zend_worklist_stack_push()
57 static inline int zend_worklist_stack_peek(zend_worklist_stack *stack) in zend_worklist_stack_peek() argument
59 ZEND_ASSERT(stack->len); in zend_worklist_stack_peek()
60 return stack->buf[stack->len - 1]; in zend_worklist_stack_peek()
63 static inline int zend_worklist_stack_pop(zend_worklist_stack *stack) in zend_worklist_stack_pop() argument
65 ZEND_ASSERT(stack->len); in zend_worklist_stack_pop()
66 return stack->buf[--stack->len]; in zend_worklist_stack_pop()
71 zend_worklist_stack stack; member
75 …(w)->stack.buf = (int*)do_alloca(ZEND_MM_ALIGNED_SIZE(sizeof(int) * _len) + sizeof(zend_ulong) * z…
76 (w)->stack.len = 0; \
77 (w)->stack.capacity = _len; \
78 (w)->visited = (zend_bitset)((char*)(w)->stack.buf + ZEND_MM_ALIGNED_SIZE(sizeof(int) * _len)); \
83 free_alloca((w)->stack.buf, use_heap)
89 return zend_worklist_stack_prepare(arena, &worklist->stack, len); in zend_worklist_prepare()
94 return worklist->stack.len; in zend_worklist_len()
99 ZEND_ASSERT(i >= 0 && i < worklist->stack.capacity); in zend_worklist_push()
106 zend_worklist_stack_push(&worklist->stack, i); in zend_worklist_push()
112 return zend_worklist_stack_peek(&worklist->stack); in zend_worklist_peek()
118 return zend_worklist_stack_pop(&worklist->stack); in zend_worklist_pop()