Ian,
Thanks for cleaning up the code to remove MdeModulePkg dependency.
Minor comments below:
UINTN NextIndex;
+ VOID *QuickSortBuffer;
1. Can you use local variable? "CPU_CACHE_INFO SortBuffer".
- PerformQuickSort (LocalCacheInfo, LocalCacheInfoCount, sizeof
(*LocalCacheInfo), (SORT_COMPARE) CpuCacheInfoCompare);
+ QuickSortBuffer = AllocateZeroPool (sizeof (*LocalCacheInfo));
+ if (QuickSortBuffer == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
2. With #1 change, you can avoid "calling AllocateZeroPool() and checking
pointer".
+ QuickSort (LocalCacheInfo, LocalCacheInfoCount, sizeof (*LocalCacheInfo),
CpuCacheInfoCompare, QuickSortBuffer);
3. Just pass "&SortBuffer" as the last parameter.
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#82193): https://edk2.groups.io/g/devel/message/82193
Mute This Topic: https://groups.io/mt/86381254/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-