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

Function npy_alloc_cache_dim

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

* dimension/stride cache, uses a different allocator and is always a multiple * of npy_intp */

Source from the content-addressed store, hash-verified

181 * of npy_intp
182 */
183NPY_NO_EXPORT void *
184npy_alloc_cache_dim(npy_uintp sz)
185{
186 /*
187 * make sure any temporary allocation can be used for array metadata which
188 * uses one memory block for both dimensions and strides
189 */
190 if (sz < 2) {
191 sz = 2;
192 }
193 return _npy_alloc_cache(sz, sizeof(npy_intp), NBUCKETS_DIM, dimcache,
194 &PyArray_malloc);
195}
196
197NPY_NO_EXPORT void
198npy_free_cache_dim(void * p, npy_uintp sz)

Callers 4

array_shape_setFunction · 0.85
array_setstateFunction · 0.85
PyArray_NewFromDescr_intFunction · 0.85
PyArray_IntpConverterFunction · 0.85

Calls 1

_npy_alloc_cacheFunction · 0.85

Tested by

no test coverage detected