| 524 | } |
| 525 | |
| 526 | static ZWRAP_DCtx* ZWRAP_createDCtx(z_streamp strm) |
| 527 | { |
| 528 | ZWRAP_DCtx* zwd; |
| 529 | ZSTD_customMem customMem = { NULL, NULL, NULL }; |
| 530 | |
| 531 | if (strm->zalloc && strm->zfree) { |
| 532 | customMem.customAlloc = ZWRAP_allocFunction; |
| 533 | customMem.customFree = ZWRAP_freeFunction; |
| 534 | } |
| 535 | customMem.opaque = strm; |
| 536 | |
| 537 | zwd = (ZWRAP_DCtx*)ZWRAP_customCalloc(sizeof(ZWRAP_DCtx), customMem); |
| 538 | if (zwd == NULL) return NULL; |
| 539 | zwd->allocFunc = *strm; |
| 540 | customMem.opaque = &zwd->allocFunc; |
| 541 | zwd->customMem = customMem; |
| 542 | |
| 543 | ZWRAP_initDCtx(zwd); |
| 544 | return zwd; |
| 545 | } |
| 546 | |
| 547 | static size_t ZWRAP_freeDCtx(ZWRAP_DCtx* zwd) |
| 548 | { |
no test coverage detected