Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions Doc/c-api/memory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -293,17 +293,23 @@ The following type-oriented macros are provided for convenience. Note that

Same as :c:func:`PyMem_Free`.

In addition, the following macro sets are provided for calling the Python memory
allocator directly, without involving the C API functions listed above. However,
note that their use does not preserve binary compatibility across Python
versions and is therefore deprecated in extension modules.

* ``PyMem_MALLOC(size)``
* ``PyMem_NEW(type, size)``
* ``PyMem_REALLOC(ptr, size)``
* ``PyMem_RESIZE(ptr, type, size)``
* ``PyMem_FREE(ptr)``
* ``PyMem_DEL(ptr)``
.. c:macro:: PyMem_MALLOC(size)
PyMem_NEW(type, size)
PyMem_REALLOC(ptr, size)
PyMem_RESIZE(ptr, type, size)
PyMem_FREE(ptr)
PyMem_DEL(ptr)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be nice to have a table, similar to what I did here.


These macros are :term:`soft deprecated` aliases for the APIs above,
provided for backwards compatibility.

.. versionchanged:: 3.4

The macros are now aliases of the corresponding mixed-case names.
Previously, their of the macros was the same, but their use did
Comment thread
encukou marked this conversation as resolved.
Outdated
not preserve binary compatibility across Python versions.

.. deprecated:: 2.0


.. _objectinterface:
Expand Down
Loading