Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Closed
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 10 additions & 5 deletions 15 Include/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -775,12 +775,17 @@ PyAPI_FUNC(void) _Py_AddToAllObjects(PyObject *, int force);
/* Without Py_TRACE_REFS, there's little enough to do that we expand code
* inline.
*/
#define _Py_NewReference(op) ( \
_Py_INC_TPALLOCS(op) _Py_COUNT_ALLOCS_COMMA \
_Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \
Py_REFCNT(op) = 1)
static inline void _Py_NewReference(PyObject *op)
{
_Py_INC_TPALLOCS(op);
_Py_INC_REFTOTAL;
Py_REFCNT(op) = 1;
}

#define _Py_ForgetReference(op) _Py_INC_TPFREES(op)
static inline void _Py_ForgetReference(PyObject *op)
{
_Py_INC_TPFREES(op);
}

#ifdef Py_LIMITED_API
PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Convert :c:func:`_Py_NewReference` and :c:func:`_Py_ForgetReference` macros
to static inline functions.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.