2 Library used for sorting routines.
4 Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved. <BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <Library/BaseLib.h>
11 #include <Library/BaseMemoryLib.h>
12 #include <Library/DebugLib.h>
13 #include <Library/MemoryAllocationLib.h>
14 #include <Library/SortLib.h>
17 Function to perform a Quick Sort alogrithm on a buffer of comparable elements.
19 Each element must be equal sized.
21 if BufferToSort is NULL, then ASSERT.
22 if CompareFunction is NULL, then ASSERT.
24 if Count is < 2 then perform no action.
25 if Size is < 1 then perform no action.
27 @param[in, out] BufferToSort on call a Buffer of (possibly sorted) elements
28 on return a buffer of sorted elements
29 @param[in] Count the number of elements in the buffer to sort
30 @param[in] ElementSize Size of an element in bytes
31 @param[in] CompareFunction The function to call to perform the comparison
37 IN OUT VOID
*BufferToSort
,
39 IN CONST UINTN ElementSize
,
40 IN SORT_COMPARE CompareFunction
45 ASSERT (BufferToSort
!= NULL
);
46 ASSERT (CompareFunction
!= NULL
);
48 Buffer
= AllocateZeroPool (ElementSize
);
49 ASSERT (Buffer
!= NULL
);
64 Not supported in Base version.
66 @param[in] Buffer1 Ignored.
67 @param[in] Buffer2 Ignored.
74 IN CONST VOID
*Buffer1
,
75 IN CONST VOID
*Buffer2
83 Not supported in Base version.
85 @param[in] Buffer1 Ignored.
86 @param[in] Buffer2 Ignored.
93 IN CONST VOID
*Buffer1
,
94 IN CONST VOID
*Buffer2
102 Not supported in Base version.
104 @param[in] Buffer1 Ignored.
105 @param[in] Buffer2 Ignored.
112 IN CONST VOID
*Buffer1
,
113 IN CONST VOID
*Buffer2