File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed 
Tests/FoundationEssentialsTests Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -2473,13 +2473,16 @@ struct LargeDataTests {
24732473    } 
24742474
24752475    @Test   func  validateMutation_cow_largeMutableBytes( )  { 
2476+         // Avoid copying a large data on platforms with constrained memory limits
2477+         #if !canImport(Darwin) || os(macOS) 
24762478        var  data  =  Data ( count:  largeCount) 
24772479        let  heldData  =  data
24782480        var  bytes  =  data. mutableBytes
24792481        bytes. storeBytes ( of:  1 ,  toByteOffset:  0 ,  as:  UInt8 . self) 
24802482
24812483        #expect( data [ 0 ]  ==  1 ) 
24822484        #expect( heldData [ 0 ]  ==  0 ) 
2485+         #endif 
24832486
24842487        var  data2  =  Data ( count:  largeCount) 
24852488        // Escape the pointer to compare after a mutation without dereferencing the pointer
@@ -2494,13 +2497,16 @@ struct LargeDataTests {
24942497    } 
24952498
24962499    @Test   func  validateMutation_cow_largeMutableSpan( )  { 
2500+         // Avoid copying a large data on platforms with constrained memory limits
2501+         #if !canImport(Darwin) || os(macOS) 
24972502        var  data  =  Data ( count:  largeCount) 
24982503        let  heldData  =  data
24992504        var  bytes  =  data. mutableSpan
25002505        bytes [ 0 ]  =  1 
25012506
25022507        #expect( data [ 0 ]  ==  1 ) 
25032508        #expect( heldData [ 0 ]  ==  0 ) 
2509+         #endif 
25042510
25052511        var  data2  =  Data ( count:  largeCount) 
25062512        // Escape the pointer to compare after a mutation without dereferencing the pointer
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments