Updated xxHash to r38
authorYann Collet <yann.collet.73@gmail.com>
Sat, 1 Nov 2014 20:58:31 +0000 (21:58 +0100)
committerYann Collet <yann.collet.73@gmail.com>
Sat, 1 Nov 2014 20:58:31 +0000 (21:58 +0100)
xxhash.c

index 529d69c..e6c2f31 100644 (file)
--- a/xxhash.c
+++ b/xxhash.c
@@ -84,14 +84,8 @@ You can contact the author at :
 // Modify the local functions below should you wish to use some other memory routines
 // for malloc(), free()
 #include <stdlib.h>
-FORCE_INLINE void* XXH_malloc(size_t s)
-{
-    return malloc(s);
-}
-FORCE_INLINE void  XXH_free  (void* p)
-{
-    free(p);
-}
+FORCE_INLINE void* XXH_malloc(size_t s) { return malloc(s); }
+FORCE_INLINE void  XXH_free  (void* p)  { free(p); }
 // for memcpy()
 #include <string.h>
 FORCE_INLINE void* XXH_memcpy(void* dest, const void* src, size_t size)
@@ -535,22 +529,22 @@ typedef struct
 XXH32_state_t* XXH32_createState(void)
 {
     XXH_STATIC_ASSERT(sizeof(XXH32_state_t) >= sizeof(XXH_istate32_t));   // A compilation error here means XXH32_state_t is not large enough
-    return (XXH32_state_t*)malloc(sizeof(XXH32_state_t));
+    return (XXH32_state_t*)XXH_malloc(sizeof(XXH32_state_t));
 }
 XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr)
 {
-    free(statePtr);
+    XXH_free(statePtr);
     return XXH_OK;
 };
 
 XXH64_state_t* XXH64_createState(void)
 {
     XXH_STATIC_ASSERT(sizeof(XXH64_state_t) >= sizeof(XXH_istate64_t));   // A compilation error here means XXH64_state_t is not large enough
-    return (XXH64_state_t*)malloc(sizeof(XXH64_state_t));
+    return (XXH64_state_t*)XXH_malloc(sizeof(XXH64_state_t));
 }
 XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr)
 {
-    free(statePtr);
+    XXH_free(statePtr);
     return XXH_OK;
 };