Lines Matching refs:stack

42 static inline int zend_worklist_stack_prepare(zend_arena **arena, zend_worklist_stack *stack, int l…  in zend_worklist_stack_prepare()  argument
46 stack->buf = (int*)zend_arena_calloc(arena, sizeof(*stack->buf), len); in zend_worklist_stack_prepare()
47 stack->len = 0; in zend_worklist_stack_prepare()
48 stack->capacity = len; in zend_worklist_stack_prepare()
53 static inline void zend_worklist_stack_push(zend_worklist_stack *stack, int i) in zend_worklist_stack_push() argument
55 ZEND_ASSERT(stack->len < stack->capacity); in zend_worklist_stack_push()
56 stack->buf[stack->len++] = i; in zend_worklist_stack_push()
59 static inline int zend_worklist_stack_peek(zend_worklist_stack *stack) in zend_worklist_stack_peek() argument
61 ZEND_ASSERT(stack->len); in zend_worklist_stack_peek()
62 return stack->buf[stack->len - 1]; in zend_worklist_stack_peek()
65 static inline int zend_worklist_stack_pop(zend_worklist_stack *stack) in zend_worklist_stack_pop() argument
67 ZEND_ASSERT(stack->len); in zend_worklist_stack_pop()
68 return stack->buf[--stack->len]; in zend_worklist_stack_pop()
73 zend_worklist_stack stack; member
77 …(w)->stack.buf = (int*)do_alloca(ZEND_MM_ALIGNED_SIZE(sizeof(int) * _len) + sizeof(zend_ulong) * z…
78 (w)->stack.len = 0; \
79 (w)->stack.capacity = _len; \
80 (w)->visited = (zend_bitset)((char*)(w)->stack.buf + ZEND_MM_ALIGNED_SIZE(sizeof(int) * _len)); \
85 free_alloca((w)->stack.buf, use_heap)
91 return zend_worklist_stack_prepare(arena, &worklist->stack, len); in zend_worklist_prepare()
96 return worklist->stack.len; in zend_worklist_len()
101 ZEND_ASSERT(i >= 0 && i < worklist->stack.capacity); in zend_worklist_push()
108 zend_worklist_stack_push(&worklist->stack, i); in zend_worklist_push()
114 return zend_worklist_stack_peek(&worklist->stack); in zend_worklist_peek()
120 return zend_worklist_stack_pop(&worklist->stack); in zend_worklist_pop()