* by modifying below section.
*/
#include <stdlib.h> /* malloc, calloc, free */
-#define ALLOC(s) malloc(s)
#ifndef LZ4_SRC_INCLUDED /* avoid redefinition when sources are coalesced */
-# define ALLOC_AND_ZERO(s) calloc(1,(s))
+# define ALLOC(s) malloc(s)
+# define ALLOC_AND_ZERO(s) calloc(1,(s))
+# define FREEMEM(p) free(p)
#endif
-#define FREEMEM(p) free(p)
#include <string.h> /* memset, memcpy, memmove */
#ifndef LZ4_SRC_INCLUDED /* avoid redefinition when sources are coalesced */
-# define MEM_INIT memset
+# define MEM_INIT(p,v,s) memset((p),(v),(s))
#endif
#endif
int const cSize = LZ4_compress_HC_extStateHC(statePtr, src, dst, srcSize, dstCapacity, compressionLevel);
#if defined(LZ4HC_HEAPMODE) && LZ4HC_HEAPMODE==1
- free(statePtr);
+ FREEMEM(statePtr);
#endif
return cSize;
}
{
DEBUGLOG(4, "LZ4_freeStreamHC(%p)", LZ4_streamHCPtr);
if (!LZ4_streamHCPtr) return 0; /* support free on NULL */
- free(LZ4_streamHCPtr);
+ FREEMEM(LZ4_streamHCPtr);
return 0;
}