* dimension/stride cache, uses a different allocator and is always a multiple * of npy_intp */
| 181 | * of npy_intp |
| 182 | */ |
| 183 | NPY_NO_EXPORT void * |
| 184 | npy_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 | |
| 197 | NPY_NO_EXPORT void |
| 198 | npy_free_cache_dim(void * p, npy_uintp sz) |
no test coverage detected