Lines Matching refs:stack
177 struct sljit_stack *stack; in sljit_allocate_stack() local
185 stack = (struct sljit_stack*)SLJIT_MALLOC(sizeof(struct sljit_stack), allocator_data); in sljit_allocate_stack()
186 if (stack == NULL) in sljit_allocate_stack()
191 SLJIT_FREE(stack, allocator_data); in sljit_allocate_stack()
195 stack->min_start = (sljit_u8 *)ptr; in sljit_allocate_stack()
196 stack->end = stack->min_start + max_size; in sljit_allocate_stack()
197 stack->start = stack->end - start_size; in sljit_allocate_stack()
198 stack->top = stack->end; in sljit_allocate_stack()
199 return stack; in sljit_allocate_stack()
202 SLJIT_API_FUNC_ATTRIBUTE void SLJIT_FUNC sljit_free_stack(struct sljit_stack *stack, void *allocato… in sljit_free_stack() argument
205 SLJIT_FREE((void*)stack->min_start, allocator_data); in sljit_free_stack()
206 SLJIT_FREE(stack, allocator_data); in sljit_free_stack()
209 SLJIT_API_FUNC_ATTRIBUTE sljit_u8 *SLJIT_FUNC sljit_stack_resize(struct sljit_stack *stack, sljit_u… in sljit_stack_resize() argument
211 if ((new_start < stack->min_start) || (new_start >= stack->end)) in sljit_stack_resize()
213 stack->start = new_start; in sljit_stack_resize()
221 SLJIT_API_FUNC_ATTRIBUTE void SLJIT_FUNC sljit_free_stack(struct sljit_stack *stack, void *allocato… in sljit_free_stack() argument
224 VirtualFree((void*)stack->min_start, 0, MEM_RELEASE); in sljit_free_stack()
225 SLJIT_FREE(stack, allocator_data); in sljit_free_stack()
230 SLJIT_API_FUNC_ATTRIBUTE void SLJIT_FUNC sljit_free_stack(struct sljit_stack *stack, void *allocato… in sljit_free_stack() argument
233 munmap((void*)stack->min_start, (size_t)(stack->end - stack->min_start)); in sljit_free_stack()
234 SLJIT_FREE(stack, allocator_data); in sljit_free_stack()
241 struct sljit_stack *stack; in sljit_allocate_stack() local
250 stack = (struct sljit_stack*)SLJIT_MALLOC(sizeof(struct sljit_stack), allocator_data); in sljit_allocate_stack()
251 if (stack == NULL) in sljit_allocate_stack()
261 SLJIT_FREE(stack, allocator_data); in sljit_allocate_stack()
265 stack->min_start = (sljit_u8 *)ptr; in sljit_allocate_stack()
266 stack->end = stack->min_start + max_size; in sljit_allocate_stack()
267 stack->start = stack->end; in sljit_allocate_stack()
269 if (sljit_stack_resize(stack, stack->end - start_size) == NULL) { in sljit_allocate_stack()
270 sljit_free_stack(stack, allocator_data); in sljit_allocate_stack()
278 SLJIT_FREE(stack, allocator_data); in sljit_allocate_stack()
284 SLJIT_FREE(stack, allocator_data); in sljit_allocate_stack()
287 stack->min_start = (sljit_u8 *)ptr; in sljit_allocate_stack()
288 stack->end = stack->min_start + max_size; in sljit_allocate_stack()
289 stack->start = stack->end - start_size; in sljit_allocate_stack()
292 stack->top = stack->end; in sljit_allocate_stack()
293 return stack; in sljit_allocate_stack()
296 SLJIT_API_FUNC_ATTRIBUTE sljit_u8 *SLJIT_FUNC sljit_stack_resize(struct sljit_stack *stack, sljit_u… in sljit_stack_resize() argument
304 if ((new_start < stack->min_start) || (new_start >= stack->end)) in sljit_stack_resize()
311 aligned_old_start = ((sljit_uw)stack->start) & ~page_align; in sljit_stack_resize()
323 if (stack->start < new_start) { in sljit_stack_resize()
327 aligned_old_start = ((sljit_uw)stack->start) & ~page_align; in sljit_stack_resize()
338 stack->start = new_start; in sljit_stack_resize()