* @brief Finds the first element in a range that does not satisfy a predicate. * * This function searches for the first element in the range `[base, base + num * size)` that does not satisfy * the predicate function `pred`. * * @param base Pointer to the start of the array. * @param num Number of elements in the array. * @param size Size of each element in bytes. * @param pred Predicate fu
| 348 | case 2: return alg_filter_loop(src, num, 2, dst, 2, NULL, NULL, NULL); |
| 349 | case 4: return alg_filter_loop(src, num, 4, dst, 2, NULL, NULL, NULL); |
| 350 | case 8: return alg_filter_loop(src, num, 8, dst, 2, NULL, NULL, NULL); |
| 351 | default: return alg_filter_loop(src, num, sz, dst, 2, NULL, NULL, NULL); |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | |
| 356 | /* ================================================================== */ |
| 357 | /* Unstable sort: pattern-defeating quicksort (pdqsort) */ |
| 358 | /* ================================================================== */ |
| 359 | /* |
| 360 | * Orson Peters' pdqsort (the unstable sort of Rust and Go), adapted to opaque |
| 361 | * elements and a comparator called through a pointer: median-of-3 / ninther |
| 362 | * pivot, branchless block partitioning (the comparison results are counted, |
| 363 | * never branched on, so random data costs no mispredictions), pattern |
| 364 | * breaking on unbalanced partitions, a separate pass for runs of elements |
| 365 | * equal to the pivot, an insertion-sort exit for already partitioned input, |
| 366 | * and heapsort after log2(n) bad partitions: O(n log n) worst case, O(n) for |
nothing calls this directly
no outgoing calls
no test coverage detected