Lines Matching defs:stack
163 struct sljit_stack *stack;
193 stack = (struct sljit_stack*)SLJIT_MALLOC(sizeof(struct sljit_stack));
194 if (!stack)
200 SLJIT_FREE(stack);
203 stack->base = base.uw;
204 stack->limit = stack->base;
205 stack->max_limit = stack->base + max_limit;
206 if (sljit_stack_resize(stack, stack->base + limit)) {
207 sljit_free_stack(stack);
213 SLJIT_FREE(stack);
216 stack->base = base.uw;
217 stack->limit = stack->base + limit;
218 stack->max_limit = stack->base + max_limit;
220 stack->top = stack->base;
221 return stack;
226 SLJIT_API_FUNC_ATTRIBUTE void SLJIT_CALL sljit_free_stack(struct sljit_stack* stack)
229 VirtualFree((void*)stack->base, 0, MEM_RELEASE);
231 munmap((void*)stack->base, stack->max_limit - stack->base);
233 SLJIT_FREE(stack);
236 SLJIT_API_FUNC_ATTRIBUTE sljit_w SLJIT_CALL sljit_stack_resize(struct sljit_stack* stack, sljit_uw new_limit)
241 if ((new_limit > stack->max_limit) || (new_limit < stack->base))
245 aligned_old_limit = (stack->limit + sljit_page_align) & ~sljit_page_align;
256 stack->limit = new_limit;
259 if (new_limit >= stack->limit) {
260 stack->limit = new_limit;
264 aligned_old_limit = (stack->limit + sljit_page_align) & ~sljit_page_align;
267 stack->limit = new_limit;