diff --git a/Doc/c-api/memory.rst b/Doc/c-api/memory.rst index 87425bcf1e71f2..74bcfda67b4463 100644 --- a/Doc/c-api/memory.rst +++ b/Doc/c-api/memory.rst @@ -272,6 +272,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 ` section. + The :ref:`default object allocator ` uses the :ref:`pymalloc memory allocator `. @@ -353,6 +359,7 @@ Legend: * ``pymalloc``: :ref:`pymalloc memory allocator ` * "+ debug": with debug hooks installed by :c:func:`PyMem_SetupDebugHooks` +.. _customize-memory-allocators: Customize Memory Allocators ===========================