diff options
author | yann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd> | 2012-12-22 17:56:05 (GMT) |
---|---|---|
committer | yann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd> | 2012-12-22 17:56:05 (GMT) |
commit | 77417fc4c2d955bdf7ffd2b8d5a5f37157def5d5 (patch) | |
tree | d9c997e6a97b89205df4c92b755b1583a316d542 /lz4hc.c | |
parent | 26b82f35d8ad765d223c4f1deec0678b6c90ed40 (diff) | |
download | lz4-77417fc4c2d955bdf7ffd2b8d5a5f37157def5d5.zip lz4-77417fc4c2d955bdf7ffd2b8d5a5f37157def5d5.tar.gz lz4-77417fc4c2d955bdf7ffd2b8d5a5f37157def5d5.tar.bz2 |
LZ4_HC is now compatible with CPU requiring aligned memory accesses
git-svn-id: https://lz4.googlecode.com/svn/trunk@87 650e7d94-2a16-8b24-b05c-7c0b3f6821cd
Diffstat (limited to 'lz4hc.c')
-rw-r--r-- | lz4hc.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -224,7 +224,7 @@ typedef struct #define LZ4_WILDCOPY(s,d,e) do { LZ4_COPYPACKET(s,d) } while (d<e);
#define LZ4_BLINDCOPY(s,d,l) { BYTE* e=d+l; LZ4_WILDCOPY(s,d,e); d=e; }
#define HASH_FUNCTION(i) (((i) * 2654435761U) >> ((MINMATCH*8)-HASH_LOG))
-#define HASH_VALUE(p) HASH_FUNCTION(*(U32*)(p))
+#define HASH_VALUE(p) HASH_FUNCTION(A32(p))
#define HASH_POINTER(p) (HashTable[HASH_VALUE(p)] + base)
#define DELTANEXT(p) chainTable[(size_t)(p) & MAXD_MASK]
#define GETNEXT(p) ((p) - (size_t)DELTANEXT(p))
@@ -357,7 +357,7 @@ inline static int LZ4HC_InsertAndFindBestMatch (LZ4HC_Data_Structure* hc4, const {
nbAttempts--;
if (*(ref+ml) == *(ip+ml))
- if (*(U32*)ref == *(U32*)ip)
+ if (A32(ref) == A32(ip))
{
const BYTE* reft = ref+MINMATCH;
const BYTE* ipt = ip+MINMATCH;
@@ -400,7 +400,7 @@ inline static int LZ4HC_InsertAndGetWiderMatch (LZ4HC_Data_Structure* hc4, const {
nbAttempts--;
if (*(startLimit + longest) == *(ref - delta + longest))
- if (*(U32*)ref == *(U32*)ip)
+ if (A32(ref) == A32(ip))
{
const BYTE* reft = ref+MINMATCH;
const BYTE* ipt = ip+MINMATCH;
|