From 0a69a6b1ca19ec59a4996fd25b24a7ba60dee827 Mon Sep 17 00:00:00 2001 From: animalize Date: Mon, 21 Sep 2020 10:35:47 +0800 Subject: [PATCH] Let MSVC force inline ZSTD_hashPtr() function ZSTD_hashPtr() function was not expanded by MSVC, led to low performance compared to GCC. --- lib/compress/zstd_compress_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compress/zstd_compress_internal.h b/lib/compress/zstd_compress_internal.h index b161a208c..50673f63a 100644 --- a/lib/compress/zstd_compress_internal.h +++ b/lib/compress/zstd_compress_internal.h @@ -647,7 +647,7 @@ static const U64 prime8bytes = 0xCF1BBCDCB7A56463ULL; static size_t ZSTD_hash8(U64 u, U32 h) { return (size_t)(((u) * prime8bytes) >> (64-h)) ; } static size_t ZSTD_hash8Ptr(const void* p, U32 h) { return ZSTD_hash8(MEM_readLE64(p), h); } -MEM_STATIC size_t ZSTD_hashPtr(const void* p, U32 hBits, U32 mls) +FORCE_INLINE_TEMPLATE size_t ZSTD_hashPtr(const void* p, U32 hBits, U32 mls) { switch(mls) {