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

Function _npy_free_cache

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

* return pointer p to cache, nelem is number of elements of the cache bucket * size (1 or sizeof(npy_intp)) of the block pointed too */

Source from the content-addressed store, hash-verified

127 * size (1 or sizeof(npy_intp)) of the block pointed too
128 */
129static inline void
130_npy_free_cache(void * p, npy_uintp nelem, npy_uint msz,
131 cache_bucket * cache, void (*dealloc)(void *))
132{
133 assert(PyGILState_Check());
134 if (p != NULL && nelem < msz) {
135 if (cache[nelem].available < NCACHE) {
136 cache[nelem].ptrs[cache[nelem].available++] = p;
137 return;
138 }
139 }
140 dealloc(p);
141}
142
143
144/*

Callers 3

npy_free_cacheFunction · 0.85
npy_free_cache_dimFunction · 0.85
default_freeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected