summaryrefslogtreecommitdiff
path: root/doc/source/reference/c-api
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2021-11-18 20:25:46 +0200
committerGitHub <noreply@github.com>2021-11-18 10:25:46 -0800
commitee6a23b1186343394d4e927b786c0c53e9446034 (patch)
tree236607980023a95e1f6371cf8aad3d5547232c91 /doc/source/reference/c-api
parent258ce2523ffad99be69afbd421d540086cb6bf61 (diff)
downloadnumpy-ee6a23b1186343394d4e927b786c0c53e9446034.tar.gz
DEP: remove allocation_tracking, deprecate PyDataMem_SetEventHook (#20394)
* DEP: remove allocation_tracking * DOC: add release note * DEP: deprecate PyDataMem_SetEventHook * DOC: fix name of release note * fixes from review * DOC: document deprecation of PyDataMem_EventHookFunc
Diffstat (limited to 'doc/source/reference/c-api')
-rw-r--r--doc/source/reference/c-api/data_memory.rst16
1 files changed, 9 insertions, 7 deletions
diff --git a/doc/source/reference/c-api/data_memory.rst b/doc/source/reference/c-api/data_memory.rst
index b779026b4..2084ab5d0 100644
--- a/doc/source/reference/c-api/data_memory.rst
+++ b/doc/source/reference/c-api/data_memory.rst
@@ -20,8 +20,8 @@ Historical overview
Since version 1.7.0, NumPy has exposed a set of ``PyDataMem_*`` functions
(:c:func:`PyDataMem_NEW`, :c:func:`PyDataMem_FREE`, :c:func:`PyDataMem_RENEW`)
which are backed by `alloc`, `free`, `realloc` respectively. In that version
-NumPy also exposed the `PyDataMem_EventHook` function described below, which
-wrap the OS-level calls.
+NumPy also exposed the `PyDataMem_EventHook` function (now deprecated)
+described below, which wrap the OS-level calls.
Since those early days, Python also improved its memory management
capabilities, and began providing
@@ -50,10 +50,10 @@ management routines can use :c:func:`PyDataMem_SetHandler`, which uses a
:c:type:`PyDataMem_Handler` structure to hold pointers to functions used to
manage the data memory. The calls are still wrapped by internal routines to
call :c:func:`PyTraceMalloc_Track`, :c:func:`PyTraceMalloc_Untrack`, and will
-use the :c:func:`PyDataMem_EventHookFunc` mechanism. Since the functions may
-change during the lifetime of the process, each ``ndarray`` carries with it the
-functions used at the time of its instantiation, and these will be used to
-reallocate or free the data memory of the instance.
+use the deprecated :c:func:`PyDataMem_EventHookFunc` mechanism. Since the
+functions may change during the lifetime of the process, each ``ndarray``
+carries with it the functions used at the time of its instantiation, and these
+will be used to reallocate or free the data memory of the instance.
.. c:type:: PyDataMem_Handler
@@ -119,7 +119,9 @@ For an example of setting up and using the PyDataMem_Handler, see the test in
thread. The hook should be written to be reentrant, if it performs
operations that might cause new allocation events (such as the
creation/destruction numpy objects, or creating/destroying Python
- objects which might cause a gc)
+ objects which might cause a gc).
+
+ Deprecated in v1.23
What happens when deallocating if there is no policy set
--------------------------------------------------------