Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
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
Prev Previous commit
Doc style fixes
Fix indentation and reword some parts to sound more natural.

Co-authored-by: Erlend E. Aasland <[email protected]>
  • Loading branch information
jbradaric and erlend-aasland authored Apr 29, 2023
commit 525705a284913d13f6722541d183e09f97a1ae36
14 changes: 7 additions & 7 deletions Doc/c-api/gcsupport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@ rules:
Analogous to :c:func:`PyObject_GC_New` but allocates *extra_size*
bytes at the end of the object (at offset
:c:member:`~PyTypeObject.tp_basicsize`).
The allocated memory is initialized: to zero, except for the
:c:type:`Python object header <PyObject>`.
The allocated memory is initialized to zeros,
except for the :c:type:`Python object header <PyObject>`.

The extra data will be deallocated with the object, but otherwise it is
not managed by Python.

.. warning::
The function is marked as unstable because the final mechanism
for reserving extra data after an instance is not yet decided.
For allocating a variable number of fields, prefer using
:c:type:`PyVarObject` and :c:member:`~PyTypeObject.tp_itemsize`
instead.
The function is marked as unstable because the final mechanism
for reserving extra data after an instance is not yet decided.
For allocating a variable number of fields, prefer using
:c:type:`PyVarObject` and :c:member:`~PyTypeObject.tp_itemsize`
instead.

.. versionadded:: 3.12

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Add ``PyUnstable_Object_GC_NewWithExtraData`` function that can be used to
Add :c:func:`PyUnstable_Object_GC_NewWithExtraData` function that can be used to
allocate additional memory after an object for data not managed by Python.