Home | History | Annotate | Download | only in libxml2

Lines Matching refs:stack

295 static int CHECK_INVARIANT(TIM_SORT_RUN_T *stack, const int stack_curr)
301 const int64_t A1 = stack[stack_curr - 2].length;
302 const int64_t B1 = stack[stack_curr - 1].length;
306 A = stack[stack_curr - 3].length;
307 B = stack[stack_curr - 2].length;
308 C = stack[stack_curr - 1].length;
334 static void TIM_SORT_MERGE(SORT_TYPE *dst, const TIM_SORT_RUN_T *stack, const int stack_curr, TEMP_STORAGE_T *store)
336 const int64_t A = stack[stack_curr - 2].length;
337 const int64_t B = stack[stack_curr - 1].length;
338 const int64_t curr = stack[stack_curr - 2].start;
393 static int TIM_SORT_COLLAPSE(SORT_TYPE *dst, TIM_SORT_RUN_T *stack, int stack_curr, TEMP_STORAGE_T *store, const size_t size)
398 /* if the stack only has one thing on it, we are done with the collapse */
402 (stack[0].length + stack[1].length == (int64_t) size))
404 TIM_SORT_MERGE(dst, stack, stack_curr, store);
405 stack[0].length += stack[1].length;
409 /* check if the invariant is off for a stack of 2 elements */
410 else if ((stack_curr == 2) && (stack[0].length <= stack[1].length))
412 TIM_SORT_MERGE(dst, stack, stack_curr, store);
413 stack[0].length += stack[1].length;
420 A = stack[stack_curr - 3].length;
421 B = stack[stack_curr - 2].length;
422 C = stack[stack_curr - 1].length;
429 TIM_SORT_MERGE(dst, stack, stack_curr - 1, store);
430 stack[stack_curr - 3].length += stack[stack_curr - 2].length;
431 stack[stack_curr - 2] = stack[stack_curr - 1];
436 TIM_SORT_MERGE(dst, stack, stack_curr, store);
437 stack[stack_curr - 2].length += stack[stack_curr - 1].length;
444 TIM_SORT_MERGE(dst, stack, stack_curr, store);
445 stack[stack_curr - 2].length += stack[stack_curr - 1].length;