| 61 | } |
| 62 | |
| 63 | void* ZSTD_customCalloc(size_t size, ZSTD_customMem customMem) |
| 64 | { |
| 65 | if (customMem.customAlloc) { |
| 66 | /* calloc implemented as malloc+memset; |
| 67 | * not as efficient as calloc, but next best guess for custom malloc */ |
| 68 | void* const ptr = customMem.customAlloc(customMem.opaque, size); |
| 69 | ZSTD_memset(ptr, 0, size); |
| 70 | return ptr; |
| 71 | } |
| 72 | return ZSTD_calloc(1, size); |
| 73 | } |
| 74 | |
| 75 | void ZSTD_customFree(void* ptr, ZSTD_customMem customMem) |
| 76 | { |
no test coverage detected