函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\sort.c Create Date:2022-07-27 07:16:15
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

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

函数原型:static void do_swap(void *a, void *b, size_t size, swap_func_t swap_func)

返回类型:void

参数:

类型参数名称
void *a
void *b
size_tsize
swap_func_tswap_func
135  如果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.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  否则如果swap_func恒等于SWAP_WORDS_32swap_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  否则如果swap_func恒等于SWAP_BYTESswap_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  否则swap_func(a, b, (int)size)
调用者
名称描述
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