MCPcopy Create free account
hub / github.com/numpy/numpy / PyDataMem_NEW_ZEROED

Function PyDataMem_NEW_ZEROED

numpy/core/src/multiarray/alloc.c:300–317  ·  view source on GitHub ↗

NUMPY_API * Allocates zeroed memory for array data. */

Source from the content-addressed store, hash-verified

298 * Allocates zeroed memory for array data.
299 */
300NPY_NO_EXPORT void *
301PyDataMem_NEW_ZEROED(size_t nmemb, size_t size)
302{
303 void *result;
304
305 result = calloc(nmemb, size);
306 if (_PyDataMem_eventhook != NULL) {
307 NPY_ALLOW_C_API_DEF
308 NPY_ALLOW_C_API
309 if (_PyDataMem_eventhook != NULL) {
310 (*_PyDataMem_eventhook)(NULL, result, nmemb * size,
311 _PyDataMem_eventhook_user_data);
312 }
313 NPY_DISABLE_C_API
314 }
315 PyTraceMalloc_Track(NPY_TRACE_DOMAIN, (npy_uintp)result, nmemb * size);
316 return result;
317}
318
319/*NUMPY_API
320 * Free memory for array data.

Callers 1

npy_alloc_cache_zeroFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected