Lines Matching refs:stack

174 	struct sljit_stack *stack;  in sljit_allocate_stack()  local
182 stack = (struct sljit_stack*)SLJIT_MALLOC(sizeof(struct sljit_stack), allocator_data); in sljit_allocate_stack()
183 if (stack == NULL) in sljit_allocate_stack()
188 SLJIT_FREE(stack, allocator_data); in sljit_allocate_stack()
192 stack->min_start = (sljit_u8 *)ptr; in sljit_allocate_stack()
193 stack->end = stack->min_start + max_size; in sljit_allocate_stack()
194 stack->start = stack->end - start_size; in sljit_allocate_stack()
195 stack->top = stack->end; in sljit_allocate_stack()
196 return stack; in sljit_allocate_stack()
199 SLJIT_API_FUNC_ATTRIBUTE void SLJIT_FUNC sljit_free_stack(struct sljit_stack *stack, void *allocato… in sljit_free_stack() argument
202 SLJIT_FREE((void*)stack->min_start, allocator_data); in sljit_free_stack()
203 SLJIT_FREE(stack, allocator_data); in sljit_free_stack()
206 SLJIT_API_FUNC_ATTRIBUTE sljit_u8 *SLJIT_FUNC sljit_stack_resize(struct sljit_stack *stack, sljit_u… in sljit_stack_resize() argument
208 if ((new_start < stack->min_start) || (new_start >= stack->end)) in sljit_stack_resize()
210 stack->start = new_start; in sljit_stack_resize()
218 SLJIT_API_FUNC_ATTRIBUTE void SLJIT_FUNC sljit_free_stack(struct sljit_stack *stack, void *allocato… in sljit_free_stack() argument
221 VirtualFree((void*)stack->min_start, 0, MEM_RELEASE); in sljit_free_stack()
222 SLJIT_FREE(stack, allocator_data); in sljit_free_stack()
227 SLJIT_API_FUNC_ATTRIBUTE void SLJIT_FUNC sljit_free_stack(struct sljit_stack *stack, void *allocato… in sljit_free_stack() argument
230 munmap((void*)stack->min_start, stack->end - stack->min_start); in sljit_free_stack()
231 SLJIT_FREE(stack, allocator_data); in sljit_free_stack()
238 struct sljit_stack *stack; in sljit_allocate_stack() local
247 stack = (struct sljit_stack*)SLJIT_MALLOC(sizeof(struct sljit_stack), allocator_data); in sljit_allocate_stack()
248 if (stack == NULL) in sljit_allocate_stack()
258 SLJIT_FREE(stack, allocator_data); in sljit_allocate_stack()
262 stack->min_start = (sljit_u8 *)ptr; in sljit_allocate_stack()
263 stack->end = stack->min_start + max_size; in sljit_allocate_stack()
264 stack->start = stack->end; in sljit_allocate_stack()
266 if (sljit_stack_resize(stack, stack->end - start_size) == NULL) { in sljit_allocate_stack()
267 sljit_free_stack(stack, allocator_data); in sljit_allocate_stack()
275 SLJIT_FREE(stack, allocator_data); in sljit_allocate_stack()
281 SLJIT_FREE(stack, allocator_data); in sljit_allocate_stack()
284 stack->min_start = (sljit_u8 *)ptr; in sljit_allocate_stack()
285 stack->end = stack->min_start + max_size; in sljit_allocate_stack()
286 stack->start = stack->end - start_size; in sljit_allocate_stack()
289 stack->top = stack->end; in sljit_allocate_stack()
290 return stack; in sljit_allocate_stack()
293 SLJIT_API_FUNC_ATTRIBUTE sljit_u8 *SLJIT_FUNC sljit_stack_resize(struct sljit_stack *stack, sljit_u… in sljit_stack_resize() argument
301 if ((new_start < stack->min_start) || (new_start >= stack->end)) in sljit_stack_resize()
308 aligned_old_start = ((sljit_uw)stack->start) & ~page_align; in sljit_stack_resize()
320 if (stack->start < new_start) { in sljit_stack_resize()
324 aligned_old_start = ((sljit_uw)stack->start) & ~page_align; in sljit_stack_resize()
335 stack->start = new_start; in sljit_stack_resize()