mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	gh-117783: Immortalize objects that use deferred reference counting (#118112)
Deferred reference counting is not fully implemented yet. As a temporary measure, we immortalize objects that would use deferred reference counting to avoid multi-threaded scaling bottlenecks. This is only performed in the free-threaded build once the first non-main thread is started. Additionally, some tests, including refleak tests, suppress this behavior.
This commit is contained in:
		
							parent
							
								
									8d4b756fd3
								
							
						
					
					
						commit
						7ccacb220d
					
				
					 13 changed files with 134 additions and 8 deletions
				
			
		|  | @ -303,7 +303,10 @@ def run_single_test(test_name: TestName, runtests: RunTests) -> TestResult: | |||
|     result = TestResult(test_name) | ||||
|     pgo = runtests.pgo | ||||
|     try: | ||||
|         _runtest(result, runtests) | ||||
|         # gh-117783: don't immortalize deferred objects when tracking | ||||
|         # refleaks. Only releveant for the free-threaded build. | ||||
|         with support.suppress_immortalization(runtests.hunt_refleak): | ||||
|             _runtest(result, runtests) | ||||
|     except: | ||||
|         if not pgo: | ||||
|             msg = traceback.format_exc() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Sam Gross
						Sam Gross