NumPy has had a way to add a call to a user-supplied function whenever allocating via PyDataMem_SetEventHook [0]. Python added the tracemalloc [1] functionality which make this redundant. NumPy also added memory alloc/free overriding in NEP 49 [2] which will be part of the 1.22 release. I propose deprecating the PyDataMem_SetEventHook function, and have submitted a PR to do so for 1.23 [3]. Thoughts? Is anyone using the hook for something that tracemalloc cannot do?

Matti


[0] https://numpy.org/devdocs/reference/c-api/data_memory.html#c.PyDataMem_SetEventHook

[1] https://docs.python.org/3/library/tracemalloc.html

[2] https://numpy.org/neps/nep-0049.html

[3] https://github.com/numpy/numpy/pull/20394

_______________________________________________
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com

Reply via email to