Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:The function pointer is last to make tail calls most efficient if the* compiler decides not to inline this function.

Proto:static void do_swap(void *a, void *b, size_t size, swap_func_t swap_func)

Type:void

Parameter:

TypeParameterName
void *a
void *b
size_tsize
swap_func_tswap_func
135  If 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. Then swap_words_64 - swap two elements in 64-bit chunks*@a: pointer to the first element to swap*@b: pointer to the second element to swap*@n: element size (must be a multiple of 8)* Exchange the two objects in memory
137  Else if swap_func == SWAP_WORDS_32 Then swap_words_32 - swap two elements in 32-bit chunks*@a: pointer to the first element to swap*@b: pointer to the second element to swap*@n: element size (must be a multiple of 4)* Exchange the two objects in memory. This exploits base+index addressing,
139  Else if swap_func == SWAP_BYTES Then swap_bytes - swap two elements a byte at a time*@a: pointer to the first element to swap*@b: pointer to the second element to swap*@n: element size* This is the fallback if alignment doesn't allow using larger chunks.
141  Else swap_func(a, b, (int)size)
Caller
NameDescribe
sort_rsort_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