Thanks for the comment. It will be taken care by V5 patch. Thanks, Ian Kuo -----Original Message----- From: Ni, Ray <ray...@intel.com> Sent: Monday, October 18, 2021 11:42 AM To: Kuo, IanX <ianx....@intel.com>; devel@edk2.groups.io Cc: Chan, Amy <amy.c...@intel.com>; Dong, Eric <eric.d...@intel.com>; Kumar, Rahul1 <rahul1.ku...@intel.com> Subject: RE: [PATCH v3 3/3] UefiCpuPkg/CpuCacheInfoLib: Add QuickSort function on BaseLib
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 (#82202): https://edk2.groups.io/g/devel/message/82202 Mute This Topic: https://groups.io/mt/86381254/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-