Algorithm-RectanglesContainingDot_XS
view release on metacpan or search on metacpan
keyword|||
leave_scope|||
lex_end|||
lex_start|||
linklist|||
listkids|||
list|||
load_module_nocontext|||vn
load_module||5.006000|v
localize|||
looks_like_bool|||
looks_like_number|||
lop|||
mPUSHi|5.009002||p
mPUSHn|5.009002||p
mPUSHp|5.009002||p
mPUSHu|5.009002||p
mXPUSHi|5.009002||p
mXPUSHn|5.009002||p
mXPUSHp|5.009002||p
mXPUSHu|5.009002||p
magic_clear_all_env|||
* expects to find its arguments on the stack, and usually pushes its
* results onto the stack, hence the 'pp' terminology. Each OP structure
* contains a pointer to the relevant pp_foo() function.
*
* This particular file just contains pp_sort(), which is complex
* enough to merit its own file! See the other pp*.c files for the rest of
* the pp_ functions.
*/
#if defined(UNDER_CE)
/* looks like 'small' is reserved word for WINCE (or somesuch)*/
#define small xsmall
#endif
#ifndef SMALLSORT
#define SMALLSORT (200)
#endif
/*
* The mergesort implementation is by Peter M. Mcilroy <pmcilroy@lucent.com>.
*
* return offset of end of list (or copy)
* } else {
* $off2 = mgsort2($offset, $runs-($runs/2), $base, $list2, $list1)
* mgsort2($off2, $runs/2, $base, $list2, $list1)
* merge the adjacent runs at $offset of $list1 into $list2
* return the offset of the end of the merged runs
* }
* }
* mgsort2(0, $runs, $base, $aux, $base);
*
* For our 5 runs, the tree of calls looks like
*
* 5
* 3 2
* 2 1 1 1
* 1 1
*
* 1 2 3 4 5
*
* and the corresponding activity looks like
*
* copy runs 1 and 2 from base to aux
* merge runs 1 and 2 from aux to base
* (run 3 is where it belongs, no copy needed)
* merge runs 12 and 3 from base to aux
* (runs 4 and 5 are where they belong, no copy needed)
* merge runs 4 and 5 from base to aux
* merge runs 123 and 45 from aux to base
*
* Note that we merge runs 1 and 2 immediately after copying them,
( run in 0.532 second using v1.01-cache-2.11-cpan-64827b87656 )