1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-29 11:21:22 +03:00

zlibWrapper: added support for custom memory allocation functions

This commit is contained in:
inikep
2016-06-02 16:52:36 +02:00
parent c4807f4d2f
commit ff9114aee3
5 changed files with 46 additions and 12 deletions

View File

@ -62,11 +62,14 @@ void *myalloc(q, n, m)
unsigned n, m;
{
q = Z_NULL;
return calloc(n, m);
void *buf = calloc(n, m);
/* printf("myalloc %p n=%d m=%d\n", buf, n, m); */
return buf;
}
void myfree(void *q, void *p)
{
/* printf("myfree %p\n", p); */
q = Z_NULL;
free(p);
}