Skip to content

Commit

Permalink
shortened ZSTD_createCStream_Advanced()
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyan4973 committed May 10, 2017
1 parent 461a9cc commit 6fb2f24
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lib/compress/zstd_compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -3136,16 +3136,8 @@ ZSTD_CStream* ZSTD_createCStream(void)

ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem)
{
ZSTD_CStream* zcs;

if (!customMem.customAlloc && !customMem.customFree) customMem = defaultCustomMem;
if (!customMem.customAlloc || !customMem.customFree) return NULL;

zcs = (ZSTD_CStream*)ZSTD_malloc(sizeof(ZSTD_CStream), customMem);
if (zcs==NULL) return NULL;
memset(zcs, 0, sizeof(ZSTD_CStream));
memcpy(&zcs->customMem, &customMem, sizeof(ZSTD_customMem));
return zcs;
/* CStream and CCtx are now same object */
return ZSTD_createCCtx_advanced(customMem);
}

size_t ZSTD_freeCStream(ZSTD_CStream* zcs)
Expand Down

0 comments on commit 6fb2f24

Please sign in to comment.