summaryrefslogtreecommitdiff
path: root/doc/source/reference/global_state.rst
diff options
context:
space:
mode:
authorGagandeep Singh <gdp.1807@gmail.com>2021-11-02 11:28:17 +0530
committerGagandeep Singh <gdp.1807@gmail.com>2021-11-02 11:28:17 +0530
commitc04509e86e97a69a0b5fcbeebdbec66faad3dbe0 (patch)
treeb5940db3ad46e55b88d566ec058007dc3c6b7e72 /doc/source/reference/global_state.rst
parent56647dd47345a7fd24b4ee8d9d52025fcdc3b9ae (diff)
parentfae6fa47a3cf9b9c64af2f5bd11a3b644b1763d2 (diff)
downloadnumpy-c04509e86e97a69a0b5fcbeebdbec66faad3dbe0.tar.gz
resolved conflicts
Diffstat (limited to 'doc/source/reference/global_state.rst')
-rw-r--r--doc/source/reference/global_state.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/source/reference/global_state.rst b/doc/source/reference/global_state.rst
index f18481235..20874ceaa 100644
--- a/doc/source/reference/global_state.rst
+++ b/doc/source/reference/global_state.rst
@@ -84,3 +84,13 @@ contiguous in memory.
Most users will have no reason to change these; for details
see the :ref:`memory layout <memory-layout>` documentation.
+
+Warn if no memory allocation policy when deallocating data
+----------------------------------------------------------
+
+Some users might pass ownership of the data pointer to the ``ndarray`` by
+setting the ``OWNDATA`` flag. If they do this without setting (manually) a
+memory allocation policy, the default will be to call ``free``. If
+``NUMPY_WARN_IF_NO_MEM_POLICY`` is set to ``"1"``, a ``RuntimeWarning`` will
+be emitted. A better alternative is to use a ``PyCapsule`` with a deallocator
+and set the ``ndarray.base``.