Lines Matching refs:stack
223 struct sljit_stack *stack; in sljit_allocate_stack() local
231 stack = (struct sljit_stack*)SLJIT_MALLOC(sizeof(struct sljit_stack), allocator_data); in sljit_allocate_stack()
232 if (stack == NULL) in sljit_allocate_stack()
237 SLJIT_FREE(stack, allocator_data); in sljit_allocate_stack()
241 stack->min_start = (sljit_u8 *)ptr; in sljit_allocate_stack()
242 stack->end = stack->min_start + max_size; in sljit_allocate_stack()
243 stack->start = stack->end - start_size; in sljit_allocate_stack()
244 stack->top = stack->end; in sljit_allocate_stack()
245 return stack; in sljit_allocate_stack()
248 SLJIT_API_FUNC_ATTRIBUTE void SLJIT_FUNC sljit_free_stack(struct sljit_stack *stack, void *allocato… in sljit_free_stack() argument
251 SLJIT_FREE((void*)stack->min_start, allocator_data); in sljit_free_stack()
252 SLJIT_FREE(stack, allocator_data); in sljit_free_stack()
255 SLJIT_API_FUNC_ATTRIBUTE sljit_u8 *SLJIT_FUNC sljit_stack_resize(struct sljit_stack *stack, sljit_u… in sljit_stack_resize() argument
257 if ((new_start < stack->min_start) || (new_start >= stack->end)) in sljit_stack_resize()
259 stack->start = new_start; in sljit_stack_resize()
277 SLJIT_API_FUNC_ATTRIBUTE void SLJIT_FUNC sljit_free_stack(struct sljit_stack *stack, void *allocato… in sljit_free_stack() argument
280 VirtualFree((void*)stack->min_start, 0, MEM_RELEASE); in sljit_free_stack()
281 SLJIT_FREE(stack, allocator_data); in sljit_free_stack()
298 SLJIT_API_FUNC_ATTRIBUTE void SLJIT_FUNC sljit_free_stack(struct sljit_stack *stack, void *allocato… in sljit_free_stack() argument
301 munmap((void*)stack->min_start, stack->end - stack->min_start); in sljit_free_stack()
302 SLJIT_FREE(stack, allocator_data); in sljit_free_stack()
309 struct sljit_stack *stack; in sljit_allocate_stack() local
318 stack = (struct sljit_stack*)SLJIT_MALLOC(sizeof(struct sljit_stack), allocator_data); in sljit_allocate_stack()
319 if (stack == NULL) in sljit_allocate_stack()
329 SLJIT_FREE(stack, allocator_data); in sljit_allocate_stack()
333 stack->min_start = (sljit_u8 *)ptr; in sljit_allocate_stack()
334 stack->end = stack->min_start + max_size; in sljit_allocate_stack()
335 stack->start = stack->end; in sljit_allocate_stack()
337 if (sljit_stack_resize(stack, stack->end - start_size) == NULL) { in sljit_allocate_stack()
338 sljit_free_stack(stack, allocator_data); in sljit_allocate_stack()
347 SLJIT_FREE(stack, allocator_data); in sljit_allocate_stack()
354 SLJIT_FREE(stack, allocator_data); in sljit_allocate_stack()
357 stack->min_start = (sljit_u8 *)ptr; in sljit_allocate_stack()
358 stack->end = stack->min_start + max_size; in sljit_allocate_stack()
359 stack->start = stack->end - start_size; in sljit_allocate_stack()
362 stack->top = stack->end; in sljit_allocate_stack()
363 return stack; in sljit_allocate_stack()
366 SLJIT_API_FUNC_ATTRIBUTE sljit_u8 *SLJIT_FUNC sljit_stack_resize(struct sljit_stack *stack, sljit_u… in sljit_stack_resize() argument
374 if ((new_start < stack->min_start) || (new_start >= stack->end)) in sljit_stack_resize()
381 aligned_old_start = ((sljit_uw)stack->start) & ~page_align; in sljit_stack_resize()
393 if (stack->start < new_start) { in sljit_stack_resize()
397 aligned_old_start = ((sljit_uw)stack->start) & ~page_align; in sljit_stack_resize()
404 stack->start = new_start; in sljit_stack_resize()