@@ -53,16 +53,10 @@ impl Drop for MiriAllocBytes {
53
53
unsafe {
54
54
match self . params {
55
55
MiriAllocParams :: Global => alloc:: dealloc ( self . ptr , alloc_layout) ,
56
- MiriAllocParams :: Isolated ( id) => {
57
- #[ cfg( target_os = "linux" ) ]
58
- {
59
- IsolatedAlloc :: dealloc ( self . ptr , alloc_layout, id)
60
- }
61
- #[ cfg( not( target_os = "linux" ) ) ]
62
- {
63
- unreachable ! ( )
64
- }
65
- }
56
+ #[ cfg( target_os = "linux" ) ]
57
+ MiriAllocParams :: Isolated ( id) => IsolatedAlloc :: dealloc ( self . ptr , alloc_layout, id) ,
58
+ #[ cfg( not( target_os = "linux" ) ) ]
59
+ MiriAllocParams :: Isolated ( _) => unreachable ! ( ) ,
66
60
}
67
61
}
68
62
}
@@ -127,16 +121,10 @@ impl AllocBytes for MiriAllocBytes {
127
121
let alloc_fn = |layout| unsafe {
128
122
match params {
129
123
MiriAllocParams :: Global => alloc:: alloc ( layout) ,
130
- MiriAllocParams :: Isolated ( id) => {
131
- #[ cfg( target_os = "linux" ) ]
132
- {
133
- IsolatedAlloc :: alloc ( layout, id)
134
- }
135
- #[ cfg( not( target_os = "linux" ) ) ]
136
- {
137
- unreachable ! ( )
138
- }
139
- }
124
+ #[ cfg( target_os = "linux" ) ]
125
+ MiriAllocParams :: Isolated ( id) => IsolatedAlloc :: alloc ( layout, id) ,
126
+ #[ cfg( not( target_os = "linux" ) ) ]
127
+ MiriAllocParams :: Isolated ( _) => unreachable ! ( ) ,
140
128
}
141
129
} ;
142
130
let alloc_bytes = MiriAllocBytes :: alloc_with ( size. to_u64 ( ) , align, params, alloc_fn)
@@ -156,16 +144,10 @@ impl AllocBytes for MiriAllocBytes {
156
144
let alloc_fn = |layout| unsafe {
157
145
match params {
158
146
MiriAllocParams :: Global => alloc:: alloc_zeroed ( layout) ,
159
- MiriAllocParams :: Isolated ( id) => {
160
- #[ cfg( target_os = "linux" ) ]
161
- {
162
- IsolatedAlloc :: alloc_zeroed ( layout, id)
163
- }
164
- #[ cfg( not( target_os = "linux" ) ) ]
165
- {
166
- unreachable ! ( )
167
- }
168
- }
147
+ #[ cfg( target_os = "linux" ) ]
148
+ MiriAllocParams :: Isolated ( id) => IsolatedAlloc :: alloc_zeroed ( layout, id) ,
149
+ #[ cfg( not( target_os = "linux" ) ) ]
150
+ MiriAllocParams :: Isolated ( _) => unreachable ! ( ) ,
169
151
}
170
152
} ;
171
153
MiriAllocBytes :: alloc_with ( size, align, params, alloc_fn) . ok ( )
0 commit comments