| 7378 | } |
| 7379 | |
| 7380 | void* ZSTD_calloc(size_t size, ZSTD_customMem customMem) |
| 7381 | { |
| 7382 | if (customMem.customAlloc) { |
| 7383 | /* calloc implemented as malloc+memset; |
| 7384 | * not as efficient as calloc, but next best guess for custom malloc */ |
| 7385 | void* const ptr = customMem.customAlloc(customMem.opaque, size); |
| 7386 | memset(ptr, 0, size); |
| 7387 | return ptr; |
| 7388 | } |
| 7389 | return calloc(1, size); |
| 7390 | } |
| 7391 | |
| 7392 | void ZSTD_free(void* ptr, ZSTD_customMem customMem) |
| 7393 | { |
no test coverage detected