Skip to content

Commit

Permalink
Add a clarification for the object-domain allocators regarding pointe…
Browse files Browse the repository at this point in the history
…r validity (pythonGH-24253)
  • Loading branch information
pablogsal authored Jan 19, 2021
1 parent 65cf1ad commit e485be5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Doc/c-api/memory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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>`.
Expand Down Expand Up @@ -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
===========================
Expand Down

0 comments on commit e485be5

Please sign in to comment.