TianoCore EDK2 master
|
#include "BaseLibInternals.h"
Go to the source code of this file.
Functions | |
VOID EFIAPI | QuickSort (IN OUT VOID *BufferToSort, IN CONST UINTN Count, IN CONST UINTN ElementSize, IN BASE_SORT_COMPARE CompareFunction, OUT VOID *BufferOneElement) |
Math worker functions.
Copyright (c) 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file QuickSort.c.
VOID EFIAPI QuickSort | ( | IN OUT VOID * | BufferToSort, |
IN CONST UINTN | Count, | ||
IN CONST UINTN | ElementSize, | ||
IN BASE_SORT_COMPARE | CompareFunction, | ||
OUT VOID * | BufferOneElement | ||
) |
This function is identical to perform QuickSort, except that is uses the pre-allocated buffer so the in place sorting does not need to allocate and free buffers constantly.
Each element must be equal sized.
if BufferToSort is NULL, then ASSERT. if CompareFunction is NULL, then ASSERT. if BufferOneElement is NULL, then ASSERT. if ElementSize is < 1, then ASSERT.
if Count is < 2 then perform no action.
[in,out] | BufferToSort | on call a Buffer of (possibly sorted) elements on return a buffer of sorted elements |
[in] | Count | the number of elements in the buffer to sort |
[in] | ElementSize | Size of an element in bytes |
[in] | CompareFunction | The function to call to perform the comparison of any 2 elements |
[out] | BufferOneElement | Caller provided buffer whose size equals to ElementSize. It's used by QuickSort() for swapping in sorting. |
Definition at line 36 of file QuickSort.c.