diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2021-01-19 13:09:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-19 13:09:06 (GMT) |
commit | e485be5b6bd5fde97d78f09e2e4cca7f363763c3 (patch) | |
tree | ba649cdfeedb11f50d2d2f8b5b6892824dffb90a /Doc | |
parent | 65cf1ad6723b6b4489fa7dda04283bb2466be531 (diff) | |
download | cpython-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.rst | 7 |
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 =========================== |