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

Function default_malloc

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

The default data mem allocator malloc routine does not make use of a ctx. It should be called only through PyDataMem_UserNEW since itself does not handle eventhook and tracemalloc logic.

Source from the content-addressed store, hash-verified

365// It should be called only through PyDataMem_UserNEW
366// since itself does not handle eventhook and tracemalloc logic.
367static inline void *
368default_malloc(void *NPY_UNUSED(ctx), size_t size)
369{
370 return _npy_alloc_cache(size, 1, NBUCKETS, datacache, &malloc);
371}
372
373// The default data mem allocator calloc routine does not make use of a ctx.
374// It should be called only through PyDataMem_UserNEW_ZEROED

Callers

nothing calls this directly

Calls 1

_npy_alloc_cacheFunction · 0.85

Tested by

no test coverage detected