diff options
author | tanjent@gmail.com <tanjent@gmail.com@77a7d1d3-4c08-bdc2-d393-d5859734b01a> | 2011-04-05 00:18:44 +0000 |
---|---|---|
committer | tanjent@gmail.com <tanjent@gmail.com@77a7d1d3-4c08-bdc2-d393-d5859734b01a> | 2011-04-05 00:18:44 +0000 |
commit | 954fc28ca3b79ffe99d12d8c8b830d9b698d2266 (patch) | |
tree | 6a6ab8e87f2753a0eb30354413edfa2b7da7c6dc | |
parent | f068a580c78997431304d9dcb22ba7d89c4333e7 (diff) | |
download | src-954fc28ca3b79ffe99d12d8c8b830d9b698d2266.tar.gz |
make murmurhash3 compile standalone on Visual Studio
make speedtest allocate 256-byte aligned blocks
git-svn-id: http://smhasher.googlecode.com/svn/trunk@125 77a7d1d3-4c08-bdc2-d393-d5859734b01a
-rw-r--r-- | MurmurHash3.cpp | 4 | ||||
-rw-r--r-- | SpeedTest.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/MurmurHash3.cpp b/MurmurHash3.cpp index 5fcbe94..1fec6a0 100644 --- a/MurmurHash3.cpp +++ b/MurmurHash3.cpp @@ -14,6 +14,10 @@ #if defined(_MSC_VER)
+typedef unsigned char uint8_t;
+typedef unsigned long uint32_t;
+typedef unsigned __int64 uint64_t;
+
#define FORCE_INLINE __forceinline
#include <stdlib.h>
diff --git a/SpeedTest.cpp b/SpeedTest.cpp index b586102..211b1e9 100644 --- a/SpeedTest.cpp +++ b/SpeedTest.cpp @@ -169,11 +169,11 @@ double SpeedTest ( pfHash hash, uint32_t seed, const int trials, const int block {
Rand r(seed);
- uint8_t * buf = new uint8_t[blocksize + 64];
+ uint8_t * buf = new uint8_t[blocksize + 512];
uint64_t t1 = reinterpret_cast<uint64_t>(buf);
- t1 = (t1 + 15) & 0xFFFFFFFFFFFFFFF0;
+ t1 = (t1 + 255) & 0xFFFFFFFFFFFFFF00;
t1 += align;
uint8_t * block = reinterpret_cast<uint8_t*>(t1);
|