Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/common/allocations.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ MEM_STATIC void* ZSTD_customMalloc(size_t size, ZSTD_customMem customMem)
MEM_STATIC void* ZSTD_customCalloc(size_t size, ZSTD_customMem customMem)
{
if (customMem.customAlloc) {
/* calloc implemented as malloc+memset;
* not as efficient as calloc, but next best guess for custom malloc */
/* calloc implemented as malloc+memset */
void* const ptr = customMem.customAlloc(customMem.opaque, size);

if (ptr == NULL) {
return NULL;
}

ZSTD_memset(ptr, 0, size);
return ptr;
}
Expand Down