NUMPY_API * Allocates zeroed memory for array data. */
| 298 | * Allocates zeroed memory for array data. |
| 299 | */ |
| 300 | NPY_NO_EXPORT void * |
| 301 | PyDataMem_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. |
no outgoing calls
no test coverage detected