/*
* CPU_HAS_EFFICIENT_UNALIGNED_MEMORY_ACCESS :
- * You can force the code to use unaligned memory access if you know your CPU can handle it.
+ * You can force the code to use unaligned memory access if you know your CPU can handle it efficiently.
*/
/* #define CPU_HAS_EFFICIENT_UNALIGNED_MEMORY_ACCESS 1 */
#if defined(CPU_HAS_EFFICIENT_UNALIGNED_MEMORY_ACCESS) \
|| defined(__ARM_FEATURE_UNALIGNED) \
|| defined(__i386__) || defined(__x86_64__) \
- || defined(_M_IX86) || defined(_M_X64)
+ || defined(_M_IX86) || defined(_M_X64) \
+ || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_8__) \
+ || (defined(_M_ARM) && (_M_ARM >= 7))
# define LZ4_UNALIGNED_ACCESS 1
#else
# define LZ4_UNALIGNED_ACCESS 0
{
if ((LZ4_UNALIGNED_ACCESS) && (LZ4_isLittleEndian()))
return *(U16*)memPtr;
+ else
{
const BYTE* p = memPtr;
return (U16)((U16)p[0] + (p[1]<<8));
*(U16*)memPtr = value;
return;
}
+ else
{
BYTE* p = memPtr;
p[0] = (BYTE) value;
*(U32*)dstPtr = *(U32*)srcPtr;
return;
}
+ else
{
BYTE* d = dstPtr;
const BYTE* s = srcPtr;
{
if ((LZ4_UNALIGNED_ACCESS) && (LZ4_isLittleEndian()))
return *(U64*)memPtr;
+ else
{
const BYTE* p = memPtr;
return (U64)((U64)p[0] + (p[1]<<8) + (p[2]<<16) + ((U64)p[3]<<24) +
((U32*)dstPtr)[1] = ((U32*)srcPtr)[1];
return;
}
+ else
{
BYTE* d = dstPtr;
const BYTE* s = srcPtr;
**************************************/
#define LZ4_VERSION_MAJOR 1 /* for major interface/format changes */
#define LZ4_VERSION_MINOR 4 /* for minor interface/format changes */
-#define LZ4_VERSION_RELEASE 0 /* for tweaks, bug-fixes, or development */
+#define LZ4_VERSION_RELEASE 1 /* for tweaks, bug-fixes, or development */
#define LZ4_VERSION_NUMBER (LZ4_VERSION_MAJOR *100*100 + LZ4_VERSION_MINOR *100 + LZ4_VERSION_RELEASE)
int LZ4_versionNumber (void);
//****************************
#define COMPRESSOR_NAME "LZ4 Compression CLI"
#ifndef LZ4_VERSION
-# define LZ4_VERSION "r122"
+# define LZ4_VERSION "r125"
#endif
#define AUTHOR "Yann Collet"
#define WELCOME_MESSAGE "*** %s %i-bits %s, by %s (%s) ***\n", COMPRESSOR_NAME, (int)(sizeof(void*)*8), LZ4_VERSION, AUTHOR, __DATE__
static void* LZ4IO_LZ4_createStream (const char* inputBuffer)
{
(void)inputBuffer;
- return calloc(4, LZ4_STREAMSIZE_U32);
+ return calloc(8, LZ4_STREAMSIZE_U64);
}
static int LZ4IO_LZ4_compress_limitedOutput_continue (void* ctx, const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel)