| 126 | } |
| 127 | |
| 128 | static void* ZWRAP_customCalloc(size_t size, ZSTD_customMem customMem) |
| 129 | { |
| 130 | if (customMem.customAlloc) { |
| 131 | /* calloc implemented as malloc+memset; |
| 132 | * not as efficient as calloc, but next best guess for custom malloc */ |
| 133 | void* const ptr = customMem.customAlloc(customMem.opaque, size); |
| 134 | memset(ptr, 0, size); |
| 135 | return ptr; |
| 136 | } |
| 137 | return calloc(1, size); |
| 138 | } |
| 139 | |
| 140 | static void ZWRAP_customFree(void* ptr, ZSTD_customMem customMem) |
| 141 | { |
no test coverage detected