@@ -94,7 +94,7 @@ pub struct VirtualMachine {
9494 pub initialized : bool ,
9595 recursion_depth : Cell < usize > ,
9696 /// C stack soft limit for detecting stack overflow (like c_stack_soft_limit)
97- #[ cfg_attr( miri, allow( dead_code) ) ]
97+ #[ cfg_attr( any ( miri, target_env = "musl" ) , allow( dead_code) ) ]
9898 c_stack_soft_limit : Cell < usize > ,
9999 /// Async generator firstiter hook (per-thread, set via sys.set_asyncgen_hooks)
100100 pub async_gen_firstiter : RefCell < Option < PyObjectRef > > ,
@@ -1424,12 +1424,12 @@ impl VirtualMachine {
14241424
14251425 /// Stack margin bytes (like _PyOS_STACK_MARGIN_BYTES).
14261426 /// 2048 * sizeof(void*) = 16KB for 64-bit.
1427- #[ cfg_attr( miri, allow( dead_code) ) ]
1427+ #[ cfg_attr( any ( miri, target_env = "musl" ) , allow( dead_code) ) ]
14281428 const STACK_MARGIN_BYTES : usize = 2048 * core:: mem:: size_of :: < usize > ( ) ;
14291429
14301430 /// Get the stack boundaries using platform-specific APIs.
14311431 /// Returns (base, top) where base is the lowest address and top is the highest.
1432- #[ cfg( all( not( miri) , windows) ) ]
1432+ #[ cfg( all( not( miri) , not ( target_env = "musl" ) , windows) ) ]
14331433 fn get_stack_bounds ( ) -> ( usize , usize ) {
14341434 use windows_sys:: Win32 :: System :: Threading :: {
14351435 GetCurrentThreadStackLimits , SetThreadStackGuarantee ,
@@ -1448,7 +1448,7 @@ impl VirtualMachine {
14481448
14491449 /// Get stack boundaries on non-Windows platforms.
14501450 /// Falls back to estimating based on current stack pointer.
1451- #[ cfg( all( not( miri) , not( windows) ) ) ]
1451+ #[ cfg( all( not( miri) , not( target_env = "musl" ) , not ( windows) ) ) ]
14521452 fn get_stack_bounds ( ) -> ( usize , usize ) {
14531453 // Use pthread_attr_getstack on platforms that support it
14541454 #[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
0 commit comments