mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	GH-138355: Remove trash_delete_later from _gc_runtime_state (#138767)
Remove trash_delete_later and trash_delete_nesting from _gc_runtime_state.
This commit is contained in:
		
							parent
							
								
									d873fb42f3
								
							
						
					
					
						commit
						b42af37ced
					
				
					 3 changed files with 7 additions and 8 deletions
				
			
		| 
						 | 
					@ -157,6 +157,11 @@ struct _ts {
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    unsigned long native_thread_id;
 | 
					    unsigned long native_thread_id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* List of objects that still need to be cleaned up, singly linked
 | 
				
			||||||
 | 
					     * via their gc headers' gc_next pointers. The list is populated by
 | 
				
			||||||
 | 
					     * _PyTrash_thread_deposit_object and cleaned up by
 | 
				
			||||||
 | 
					     * _PyTrash_thread_destroy_chain.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
    PyObject *delete_later;
 | 
					    PyObject *delete_later;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* Tagged pointer to top-most critical section, or zero if there is no
 | 
					    /* Tagged pointer to top-most critical section, or zero if there is no
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -203,12 +203,6 @@ enum _GCPhase {
 | 
				
			||||||
#define NUM_GENERATIONS 3
 | 
					#define NUM_GENERATIONS 3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct _gc_runtime_state {
 | 
					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? */
 | 
					    /* Is automatic collection enabled? */
 | 
				
			||||||
    int enabled;
 | 
					    int enabled;
 | 
				
			||||||
    int debug;
 | 
					    int debug;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3051,7 +3051,7 @@ Py_ReprLeave(PyObject *obj)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Trashcan support. */
 | 
					/* 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.
 | 
					 * call-stack depth gets large.  op must be a gc'ed object, with refcount 0.
 | 
				
			||||||
 *  Py_DECREF must already have been called on it.
 | 
					 *  Py_DECREF must already have been called on it.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
| 
						 | 
					@ -3077,7 +3077,7 @@ _PyTrash_thread_deposit_object(PyThreadState *tstate, PyObject *op)
 | 
				
			||||||
    tstate->delete_later = 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. */
 | 
					 * Called when the call-stack unwinds again. */
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
_PyTrash_thread_destroy_chain(PyThreadState *tstate)
 | 
					_PyTrash_thread_destroy_chain(PyThreadState *tstate)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue