added ZBUFF_createCCtx_advanced and ZBUFF_createDCtx_advanced
This commit is contained in:
@@ -128,7 +128,7 @@ ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem)
|
||||
{
|
||||
ZSTD_CCtx* ctx;
|
||||
|
||||
if (!customMem.customAlloc || !customMem.customFree)
|
||||
if (!customMem.customAlloc && !customMem.customFree)
|
||||
{
|
||||
ctx = (ZSTD_CCtx*) calloc(1, sizeof(ZSTD_CCtx));
|
||||
if (!ctx) return NULL;
|
||||
@@ -138,6 +138,9 @@ ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem)
|
||||
return ctx;
|
||||
}
|
||||
|
||||
if (!customMem.customAlloc || !customMem.customFree)
|
||||
return NULL;
|
||||
|
||||
ctx = (ZSTD_CCtx*) customMem.customAlloc(sizeof(ZSTD_CCtx));
|
||||
if (!ctx) return NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user