mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	bpo-40514: Add --with-experimental-isolated-subinterpreters (GH-19926)
Add --with-experimental-isolated-subinterpreters build option to configure: better isolate subinterpreters, experimental build mode. When used, force the usage of the libc malloc() memory allocator, since pymalloc relies on the unique global interpreter lock (GIL).
This commit is contained in:
		
							parent
							
								
									0b1e3307e2
								
							
						
					
					
						commit
						c5fa364f4e
					
				
					 5 changed files with 60 additions and 0 deletions
				
			
		|  | @ -291,7 +291,17 @@ _PyPreConfig_InitCompatConfig(PyPreConfig *config) | |||
|     config->coerce_c_locale_warn = 0; | ||||
| 
 | ||||
|     config->dev_mode = -1; | ||||
| #ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS | ||||
|     /* bpo-40512: pymalloc is not compatible with subinterpreters,
 | ||||
|        force usage of libc malloc() which is thread-safe. */ | ||||
| #ifdef Py_DEBUG | ||||
|     config->allocator = PYMEM_ALLOCATOR_MALLOC_DEBUG; | ||||
| #else | ||||
|     config->allocator = PYMEM_ALLOCATOR_MALLOC; | ||||
| #endif | ||||
| #else | ||||
|     config->allocator = PYMEM_ALLOCATOR_NOT_SET; | ||||
| #endif | ||||
| #ifdef MS_WINDOWS | ||||
|     config->legacy_windows_fs_encoding = -1; | ||||
| #endif | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner