Lines Matching refs:customMem

121 static void* ZWRAP_customMalloc(size_t size, ZSTD_customMem customMem)  in ZWRAP_customMalloc()  argument
123 if (customMem.customAlloc) in ZWRAP_customMalloc()
124 return customMem.customAlloc(customMem.opaque, size); in ZWRAP_customMalloc()
128 static void* ZWRAP_customCalloc(size_t size, ZSTD_customMem customMem) in ZWRAP_customCalloc() argument
130 if (customMem.customAlloc) { in ZWRAP_customCalloc()
133 void* const ptr = customMem.customAlloc(customMem.opaque, size); in ZWRAP_customCalloc()
140 static void ZWRAP_customFree(void* ptr, ZSTD_customMem customMem) in ZWRAP_customFree() argument
143 if (customMem.customFree) in ZWRAP_customFree()
144 customMem.customFree(customMem.opaque, ptr); in ZWRAP_customFree()
160 ZSTD_customMem customMem; member
176 ZWRAP_customFree(zwc, zwc->customMem); in ZWRAP_freeCCtx()
184 ZSTD_customMem customMem = { NULL, NULL, NULL }; in ZWRAP_createCCtx() local
187 customMem.customAlloc = ZWRAP_allocFunction; in ZWRAP_createCCtx()
188 customMem.customFree = ZWRAP_freeFunction; in ZWRAP_createCCtx()
190 customMem.opaque = strm; in ZWRAP_createCCtx()
192 zwc = (ZWRAP_CCtx*)ZWRAP_customCalloc(sizeof(ZWRAP_CCtx), customMem); in ZWRAP_createCCtx()
195 customMem.opaque = &zwc->allocFunc; in ZWRAP_createCCtx()
196 zwc->customMem = customMem; in ZWRAP_createCCtx()
341 zwc->zbc = ZSTD_createCStream_advanced(zwc->customMem); in z_deflateSetDictionary()
367 zwc->zbc = ZSTD_createCStream_advanced(zwc->customMem); in z_deflate()
514 ZSTD_customMem customMem; member
529 ZSTD_customMem customMem = { NULL, NULL, NULL }; in ZWRAP_createDCtx() local
532 customMem.customAlloc = ZWRAP_allocFunction; in ZWRAP_createDCtx()
533 customMem.customFree = ZWRAP_freeFunction; in ZWRAP_createDCtx()
535 customMem.opaque = strm; in ZWRAP_createDCtx()
537 zwd = (ZWRAP_DCtx*)ZWRAP_customCalloc(sizeof(ZWRAP_DCtx), customMem); in ZWRAP_createDCtx()
540 customMem.opaque = &zwd->allocFunc; in ZWRAP_createDCtx()
541 zwd->customMem = customMem; in ZWRAP_createDCtx()
551 ZWRAP_customFree(zwd->version, zwd->customMem); in ZWRAP_freeDCtx()
552 ZWRAP_customFree(zwd, zwd->customMem); in ZWRAP_freeDCtx()
594 zwd->version = (char*)ZWRAP_customMalloc(strlen(version)+1, zwd->customMem); in z_inflateInit_()
817 zwd->zbd = ZSTD_createDStream_advanced(zwd->customMem); in z_inflate()