Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions Include/cpython/pystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ struct _ts {
*/
unsigned long native_thread_id;

/* List of objects that still need to be cleaned up, singly linked
* via their gc headers' gc_next pointers. */
Copy link
Member

Choose a reason for hiding this comment

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

You may mention _PyTrash_thread_deposit_object().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vstinner Please take a look.

PyObject *delete_later;

/* Tagged pointer to top-most critical section, or zero if there is no
Expand Down
6 changes: 0 additions & 6 deletions Include/internal/pycore_interp_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,6 @@ enum _GCPhase {
#define NUM_GENERATIONS 3

struct _gc_runtime_state {
/* List of objects that still need to be cleaned up, singly linked
* via their gc headers' gc_prev pointers. */
PyObject *trash_delete_later;
/* Current call-stack depth of tp_dealloc calls. */
int trash_delete_nesting;

/* Is automatic collection enabled? */
int enabled;
int debug;
Expand Down
4 changes: 2 additions & 2 deletions Objects/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -3050,7 +3050,7 @@ Py_ReprLeave(PyObject *obj)

/* Trashcan support. */

/* Add op to the gcstate->trash_delete_later list. Called when the current
/* Add op to the tstate->delete_later list. Called when the current
* call-stack depth gets large. op must be a gc'ed object, with refcount 0.
* Py_DECREF must already have been called on it.
*/
Expand All @@ -3076,7 +3076,7 @@ _PyTrash_thread_deposit_object(PyThreadState *tstate, PyObject *op)
tstate->delete_later = op;
}

/* Deallocate all the objects in the gcstate->trash_delete_later list.
/* Deallocate all the objects in the tstate->delete_later list.
* Called when the call-stack unwinds again. */
void
_PyTrash_thread_destroy_chain(PyThreadState *tstate)
Expand Down
Loading