Skip to content

Commit 7905374

Browse files
[3.14] gh-141004: Document deprecated aliases for memory allocation (GH-141146) (GH-141288)
gh-141004: Document deprecated aliases for memory allocation (GH-141146) (cherry picked from commit 1d738de) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
1 parent d6b4f4b commit 7905374

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

Doc/c-api/allocation.rst

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ Allocating Objects on the Heap
140140
* :c:member:`~PyTypeObject.tp_alloc`
141141

142142

143-
.. c:function:: void PyObject_Del(void *op)
144-
145-
Same as :c:func:`PyObject_Free`.
146-
147143
.. c:var:: PyObject _Py_NoneStruct
148144
149145
Object which is visible in Python as ``None``. This should only be accessed
@@ -156,3 +152,35 @@ Allocating Objects on the Heap
156152
:ref:`moduleobjects`
157153
To allocate and create extension modules.
158154

155+
156+
Deprecated aliases
157+
^^^^^^^^^^^^^^^^^^
158+
159+
These are :term:`soft deprecated` aliases to existing functions and macros.
160+
They exist solely for backwards compatibility.
161+
162+
163+
.. list-table::
164+
:widths: auto
165+
:header-rows: 1
166+
167+
* * Deprecated alias
168+
* Function
169+
* * .. c:macro:: PyObject_NEW(type, typeobj)
170+
* :c:macro:`PyObject_New`
171+
* * .. c:macro:: PyObject_NEW_VAR(type, typeobj, n)
172+
* :c:macro:`PyObject_NewVar`
173+
* * .. c:macro:: PyObject_INIT(op, typeobj)
174+
* :c:func:`PyObject_Init`
175+
* * .. c:macro:: PyObject_INIT_VAR(op, typeobj, n)
176+
* :c:func:`PyObject_InitVar`
177+
* * .. c:macro:: PyObject_MALLOC(n)
178+
* :c:func:`PyObject_Malloc`
179+
* * .. c:macro:: PyObject_REALLOC(p, n)
180+
* :c:func:`PyObject_Realloc`
181+
* * .. c:macro:: PyObject_FREE(p)
182+
* :c:func:`PyObject_Free`
183+
* * .. c:macro:: PyObject_DEL(p)
184+
* :c:func:`PyObject_Free`
185+
* * .. c:macro:: PyObject_Del(p)
186+
* :c:func:`PyObject_Free`

0 commit comments

Comments
 (0)