1
0
mirror of https://github.com/facebook/zstd.git synced 2025-08-08 17:22:10 +03:00

Merge pull request #198 from inikep/dev070

Dev070
This commit is contained in:
Yann Collet
2016-06-03 21:37:49 +02:00
22 changed files with 421 additions and 292 deletions

View File

@@ -129,16 +129,18 @@ static unsigned FUZ_highbit32(U32 v32)
}
*/
void* ZBUFF_allocFunction(size_t size)
static void* ZBUFF_allocFunction(void* opaque, size_t size)
{
void* address = malloc(size);
/* DISPLAYLEVEL(4, "alloc %p, %d \n", address, (int)size); */
(void)opaque;
/* DISPLAYLEVEL(4, "alloc %p, %d opaque=%p \n", address, (int)size, opaque); */
return address;
}
void ZBUFF_freeFunction(void* address)
static void ZBUFF_freeFunction(void* opaque, void* address)
{
/* if (address) DISPLAYLEVEL(4, "free %p \n", address); */
(void)opaque;
/* if (address) DISPLAYLEVEL(4, "free %p opaque=%p \n", address, opaque); */
free(address);
}
@@ -518,8 +520,8 @@ int main(int argc, const char** argv)
int result=0;
U32 mainPause = 0;
const char* programName = argv[0];
ZSTD_customMem customMem = { ZBUFF_allocFunction, ZBUFF_freeFunction };
ZSTD_customMem customNULL = { NULL, NULL };
ZSTD_customMem customMem = { ZBUFF_allocFunction, ZBUFF_freeFunction, NULL };
ZSTD_customMem customNULL = { NULL, NULL, NULL };
/* Check command line */
for(argNb=1; argNb<argc; argNb++) {