]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add a clarification for the object-domain allocators regarding pointer validity ...
authorPablo Galindo <Pablogsal@gmail.com>
Tue, 19 Jan 2021 13:09:06 +0000 (13:09 +0000)
committerGitHub <noreply@github.com>
Tue, 19 Jan 2021 13:09:06 +0000 (13:09 +0000)
Doc/c-api/memory.rst

index bd73780cc0f8e819e005afd38886932e657e0e1f..0597ef71366571765b64200daf5e70b9018df37a 100644 (file)
@@ -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
 ===========================