Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\sort.c Create Date:2022-07-28 06:19:15
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:sort_r - sort an array of elements*@base: pointer to data to sort*@num: number of elements*@size: size of each element*@cmp_func: pointer to comparison function*@swap_func: pointer to swap function or NULL*@priv: third argument passed to comparison

Proto:void sort_r(void *base, size_t num, size_t size, cmp_r_func_t cmp_func, swap_func_t swap_func, const void *priv)

Type:void

Parameter:

TypeParameterName
void *base
size_tnum
size_tsize
cmp_r_func_tcmp_func
swap_func_tswap_func
const void *priv
205  n = num * size , a = num / 2 * size
206  lsbit = size & -size
208  If Not a Then Return
211  If Not swap_func Then
212  If s_aligned - is this pointer & size okay for word-wide copying?*@base: pointer to data*@size: size of each element*@align: required alignment (typically 4 or 8)* Returns true if elements can be copied using word loads and stores Then swap_func = The values are arbitrary as long as they can't be confused with* a pointer, but small integers make for the smallest compare* instructions.
214  Else if s_aligned - is this pointer & size okay for word-wide copying?*@base: pointer to data*@size: size of each element*@align: required alignment (typically 4 or 8)* Returns true if elements can be copied using word loads and stores Then swap_func = SWAP_WORDS_32
216  Else swap_func = SWAP_BYTES
227  cycle
230  If a Then a -= size
232  Else if n -= size Then The function pointer is last to make tail calls most efficient if the* compiler decides not to inline this function.
234  Else Break
249  When c = 2 * b + size , (d = c + size ) < n cycle b = If do_cmp(base + c, base + d, cmp_func, priv) >= 0 Then c Else d
251  If d == n Then b = c
255  When b != a && do_cmp(base + a, base + b, cmp_func, priv) >= 0 cycle
256  b = parent - given the offset of the child, find the offset of the parent
257  c = b
258  When b != a cycle
Caller
NameDescribe
sort