summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2021-01-19 13:09:06 (GMT)
committerGitHub <noreply@github.com>2021-01-19 13:09:06 (GMT)
commite485be5b6bd5fde97d78f09e2e4cca7f363763c3 (patch)
treeba649cdfeedb11f50d2d2f8b5b6892824dffb90a /Doc
parent65cf1ad6723b6b4489fa7dda04283bb2466be531 (diff)
downloadcpython-e485be5b6bd5fde97d78f09e2e4cca7f363763c3.zip
cpython-e485be5b6bd5fde97d78f09e2e4cca7f363763c3.tar.gz
cpython-e485be5b6bd5fde97d78f09e2e4cca7f363763c3.tar.bz2
Add a clarification for the object-domain allocators regarding pointer validity (GH-24253)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/memory.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/c-api/memory.rst b/Doc/c-api/memory.rst
index bd73780..0597ef7 100644
--- a/Doc/c-api/memory.rst
+++ b/Doc/c-api/memory.rst
@@ -304,6 +304,12 @@ The following function sets, modeled after the ANSI C standard, but specifying
behavior when requesting zero bytes, are available for allocating and releasing
memory from the Python heap.
+.. note::
+ There is no guarantee that the memory returned by these allocators can be
+ succesfully casted to a Python object when intercepting the allocating
+ functions in this domain by the methods described in
+ the :ref:`Customize Memory Allocators <customize-memory-allocators>` section.
+
The :ref:`default object allocator <default-memory-allocators>` uses the
:ref:`pymalloc memory allocator <pymalloc>`.
@@ -385,6 +391,7 @@ Legend:
* ``pymalloc``: :ref:`pymalloc memory allocator <pymalloc>`
* "+ debug": with debug hooks installed by :c:func:`PyMem_SetupDebugHooks`
+.. _customize-memory-allocators:
Customize Memory Allocators
===========================