From fa944e19600500863507ed8e9b1f5a30037d9df6 Mon Sep 17 00:00:00 2001 From: Mircho Rodozov Date: Tue, 29 Jun 2021 21:09:43 +0300 Subject: [PATCH] Remove arch macros checks for getSmallObjectIndex (#461) Remove arch macros checks for getSmallObjectIndex Signed-off-by: Alexei Katranov --- src/tbbmalloc/frontend.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/tbbmalloc/frontend.cpp b/src/tbbmalloc/frontend.cpp index 48f72149d6..8040ec0417 100644 --- a/src/tbbmalloc/frontend.cpp +++ b/src/tbbmalloc/frontend.cpp @@ -802,21 +802,15 @@ static inline unsigned int highestBitPos(unsigned int n) return pos; } - -#if __TBB_x86_32 || __aarch32__ unsigned int getSmallObjectIndex(unsigned int size) { - return (size-1)>>3; -} -#elif __TBB_x86_64 || __aarch64__ -unsigned int getSmallObjectIndex(unsigned int size) -{ - // For 64-bit malloc, 16 byte alignment is needed except for bin 0. unsigned int result = (size-1)>>3; - if (result) result |= 1; // 0,1,3,5,7; bins 2,4,6 are not aligned to 16 bytes + if (sizeof(void*)==8) { + // For 64-bit malloc, 16 byte alignment is needed except for bin 0. + if (result) result |= 1; // 0,1,3,5,7; bins 2,4,6 are not aligned to 16 bytes + } return result; } -#endif // __TBB_x86_32 || __aarch32__ /* * Depending on indexRequest, for a given size return either the index into the bin