MCPcopy Create free account
hub / github.com/catboost/catboost / calloc

Function calloc

library/cpp/balloc/balloc.cpp:203–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203extern "C" void* calloc(size_t n, size_t elemSize) {
204 const size_t size = n * elemSize;
205
206 if (elemSize != 0 && size / elemSize != n) {
207 return nullptr;
208 }
209
210#if defined(Y_COVER_PTR)
211 void* result = malloc(size);
212#else
213 void* result = NBalloc::Malloc(size);
214#endif
215
216 if (result) {
217 memset(result, 0, size);
218 }
219
220 return result;
221}
222
223extern "C" void cfree(void* ptr) {
224#if defined(Y_COVER_PTR)

Callers 15

CountMappedFunction · 0.50
__Pyx_State_AddModuleFunction · 0.50
FASTCOVER_ctx_initFunction · 0.50
FASTCOVER_tryParametersFunction · 0.50
UTIL_mergeFileNamesTableFunction · 0.50
BMK_benchFilesAdvancedFunction · 0.50
xallocFunction · 0.50
ZSTD_createCCtxFunction · 0.50
qh_initflagsFunction · 0.50

Calls 2

mallocFunction · 0.70
MallocFunction · 0.70

Tested by

no test coverage detected