@@ -5,7 +5,7 @@ use std::{alloc, slice};
5
5
use rustc_abi:: { Align , Size } ;
6
6
use rustc_middle:: mir:: interpret:: AllocBytes ;
7
7
8
- #[ cfg( all ( unix , any ( target_arch = "x86" , target_arch = "x86_64" ) ) ) ]
8
+ #[ cfg( target_os = "linux" ) ]
9
9
use crate :: discrete_alloc:: MachineAlloc ;
10
10
use crate :: helpers:: ToU64 as _;
11
11
@@ -42,9 +42,9 @@ impl Drop for MiriAllocBytes {
42
42
43
43
// SAFETY: Invariant, `self.ptr` points to memory allocated with `self.layout`.
44
44
unsafe {
45
- #[ cfg( all ( unix , any ( target_arch = "x86" , target_arch = "x86_64" ) ) ) ]
45
+ #[ cfg( target_os = "linux" ) ]
46
46
MachineAlloc :: dealloc ( self . ptr , alloc_layout) ;
47
- #[ cfg( not( all ( unix , any ( target_arch = "x86" , target_arch = "x86_64" ) ) ) ) ]
47
+ #[ cfg( not( target_os = "linux" ) ) ]
48
48
alloc:: dealloc ( self . ptr , alloc_layout) ;
49
49
}
50
50
}
@@ -100,11 +100,11 @@ impl AllocBytes for MiriAllocBytes {
100
100
let align = align. bytes ( ) ;
101
101
// SAFETY: `alloc_fn` will only be used with `size != 0`.
102
102
let alloc_fn = |layout| unsafe {
103
- #[ cfg( all ( unix , any ( target_arch = "x86" , target_arch = "x86_64" ) ) ) ]
103
+ #[ cfg( target_os = "linux" ) ]
104
104
{
105
105
MachineAlloc :: alloc ( layout)
106
106
}
107
- #[ cfg( not( all ( unix , any ( target_arch = "x86" , target_arch = "x86_64" ) ) ) ) ]
107
+ #[ cfg( not( target_os = "linux" ) ) ]
108
108
{
109
109
alloc:: alloc ( layout)
110
110
}
@@ -124,11 +124,11 @@ impl AllocBytes for MiriAllocBytes {
124
124
let align = align. bytes ( ) ;
125
125
// SAFETY: `alloc_fn` will only be used with `size != 0`.
126
126
let alloc_fn = |layout| unsafe {
127
- #[ cfg( all ( unix , any ( target_arch = "x86" , target_arch = "x86_64" ) ) ) ]
127
+ #[ cfg( target_os = "linux" ) ]
128
128
{
129
129
MachineAlloc :: alloc_zeroed ( layout)
130
130
}
131
- #[ cfg( not( all ( unix , any ( target_arch = "x86" , target_arch = "x86_64" ) ) ) ) ]
131
+ #[ cfg( not( target_os = "linux" ) ) ]
132
132
{
133
133
alloc:: alloc_zeroed ( layout)
134
134
}
0 commit comments