summaryrefslogtreecommitdiffstats
path: root/contrib/libs/zstd/lib/common/mem.h
diff options
context:
space:
mode:
authorrobot-contrib <[email protected]>2025-02-21 20:33:28 +0300
committerrobot-contrib <[email protected]>2025-02-21 22:22:00 +0300
commit005b8a9fd31e325164fdaad9ccde51222d9dc1c7 (patch)
tree927528cb5e48c5a3af50e324fd4476fe7d3c9657 /contrib/libs/zstd/lib/common/mem.h
parent74abb8215ba55f6017c2504dc3312470949afa89 (diff)
Update contrib/libs/zstd to 1.5.7
Release highlights are: * The compression speed for small data blocks has been notably (~10%) improved at fast compression levels. * The `--patch-from` functionality of the zstd CLI ... had its speed reduced to uncomfortable levels. v1.5.7 largely mitigates the speed impact of high compression levels 18+ * The compression ratio has been enhanced slightly for large data across all compression levels, commit_hash:c66283dd802e1fd38484f7179848006c58f2baa4
Diffstat (limited to 'contrib/libs/zstd/lib/common/mem.h')
-rw-r--r--contrib/libs/zstd/lib/common/mem.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/contrib/libs/zstd/lib/common/mem.h b/contrib/libs/zstd/lib/common/mem.h
index 096f4be519d..e66a2eaeb27 100644
--- a/contrib/libs/zstd/lib/common/mem.h
+++ b/contrib/libs/zstd/lib/common/mem.h
@@ -11,10 +11,6 @@
#ifndef MEM_H_MODULE
#define MEM_H_MODULE
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
/*-****************************************
* Dependencies
******************************************/
@@ -30,6 +26,8 @@ extern "C" {
#if defined(_MSC_VER) /* Visual Studio */
# include <stdlib.h> /* _byteswap_ulong */
# include <intrin.h> /* _byteswap_* */
+#elif defined(__ICCARM__)
+# include <intrinsics.h>
#endif
/*-**************************************************************
@@ -74,7 +72,6 @@ extern "C" {
typedef signed long long S64;
#endif
-
/*-**************************************************************
* Memory I/O API
*****************************************************************/
@@ -150,10 +147,12 @@ MEM_STATIC unsigned MEM_isLittleEndian(void)
return 1;
#elif defined(__clang__) && __BIG_ENDIAN__
return 0;
-#elif defined(_MSC_VER) && (_M_AMD64 || _M_IX86)
+#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
return 1;
#elif defined(__DMC__) && defined(_M_IX86)
return 1;
+#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
+ return 1;
#else
const union { U32 u; BYTE c[4]; } one = { 1 }; /* don't use static : performance detrimental */
return one.c[0];
@@ -246,6 +245,8 @@ MEM_STATIC U32 MEM_swap32(U32 in)
#elif (defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)) \
|| (defined(__clang__) && __has_builtin(__builtin_bswap32))
return __builtin_bswap32(in);
+#elif defined(__ICCARM__)
+ return __REV(in);
#else
return MEM_swap32_fallback(in);
#endif
@@ -418,9 +419,4 @@ MEM_STATIC void MEM_writeBEST(void* memPtr, size_t val)
/* code only tested on 32 and 64 bits systems */
MEM_STATIC void MEM_check(void) { DEBUG_STATIC_ASSERT((sizeof(size_t)==4) || (sizeof(size_t)==8)); }
-
-#if defined (__cplusplus)
-}
-#endif
-
#endif /* MEM_H_MODULE */