sort_r_nonatomic(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… sort_r_nonatomic(9) β€” Kernel API Manual πŸ¦‹

okay bestie, welcome to the sort_r_nonatomic(9) page, like the actual kernel API manual, and no I will not be normal about it ✨


πŸŽ€ NAME πŸŽ€

sort_r_nonatomic β€” sort an array of elements, with cond_resched

like literally the whole vibe is "sorting but polite about it" πŸ’–


🌸 SYNOPSIS 🌸

void sort_r_nonatomic (void *base , size_t num , size_t size ,
cmp_r_func_t cmp_func , swap_r_func_t swap_func , const void *priv );

✨ ARGUMENTS ✨

  • base β€” pointer to data to sort. yes queen, this is your array, hand it over 🫢
  • num β€” number of elements. how many lil guys are we sorting, be honest πŸ’…
  • size β€” size of each element. every element's own personal size, respect it
  • cmp_func β€” pointer to comparison function. the icon that decides who goes first πŸ‘‘
  • swap_func β€” pointer to swap function or NULL. if you don't bring your own swap it's fine, NULL is valid, no pressure 😌
  • priv β€” third argument passed to comparison function. a lil extra something that gets carried along to cmp_func, iykyk 🎁

🌈 DESCRIPTION 🌈

Same as sort_r, but preferred for larger arrays as it does a periodic cond_resched. fr fr, on big boi arrays this one is the main character β€” it takes little breathers along the way so the rest of the kernel can breathe too πŸ§šπŸ’œ


πŸ’€ SEE ALSO πŸ’€

Kernel file ./lib/sort.c is_aligned(9), swap_words_32(9), swap_words_64(9), swap_bytes(9), parent(9), sort_r(9) β€” go read the whole friend group, they're all iconic ⭐


and that's the page bestie!! this whole thing lives in ./lib, dated October 2026, and it's literally titled sort_r_nonatomic(9). slay, go sort something πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from