benilla-re systems structs docs

_shortsort

function · crt · primitive

Address
0x73f87b · 78 bytes, up to 0x73f8c8
Signature
void __cdecl (char *lo, char *hi, uint32_t width, int (*compare)(const void *, const void *))
Meaning
Sorts a range of at most 8 elements by moving the first maximum to the end until the range is empty
Confidence
verified, proof one
Name from
the community database (idb)
Finding
ui/auctionlists#the-qsort-short-sort
Test
ui::crt_qsort_difftest

Finding: The qsort short sort in ui: auction lists, sorting and deposits

shortsort(lo, hi, width, comp) (0x73f87b) is a selection sort. While hi > lo it sets max to lo and scans p from lo + width to hi, setting max to p when comp(p, max) > 0, so of equal elements the first stays the maximum. It then swaps max with hi and lowers hi by width. The first argument of every call is the scanned element. swap(a, b, width) (0x73f8c9) exchanges width bytes one at a time, and does nothing when a == b or width is 0.

The derivation is in the doc.

Callers 1

Callees 1

Calls and jumps by a bare address, from tables/calls.tsv.