File tree Expand file tree Collapse file tree 3 files changed +4
-13
lines changed Expand file tree Collapse file tree 3 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,10 @@ const dispatch_block_t _dispatch_data_destructor_none = ^{
108
108
DISPATCH_INTERNAL_CRASH (0 , "none destructor called" );
109
109
};
110
110
111
+ const dispatch_block_t _dispatch_data_destructor_munmap = ^{
112
+ DISPATCH_INTERNAL_CRASH (0 , "munmap destructor called" );
113
+ };
114
+
111
115
const dispatch_block_t _dispatch_data_destructor_vm_deallocate = ^{
112
116
DISPATCH_INTERNAL_CRASH (0 , "vmdeallocate destructor called" );
113
117
};
Original file line number Diff line number Diff line change @@ -24,27 +24,18 @@ public struct DispatchData : RandomAccessCollection {
24
24
/// Use `free`
25
25
case free
26
26
27
- #if HAVE_MACH
28
27
/// Use `munmap`
29
28
case unmap
30
- #endif
31
29
32
30
/// A custom deallocator
33
31
case custom( DispatchQueue ? , @convention ( block) ( ) -> Void )
34
32
35
33
private var _deallocator : ( DispatchQueue ? , @convention ( block) ( ) -> Void ) {
36
- #if HAVE_MACH
37
34
switch self {
38
35
case . free: return ( nil , _dispatch_data_destructor_free ( ) )
39
36
case . unmap: return ( nil , _dispatch_data_destructor_munmap ( ) )
40
37
case . custom( let q, let b) : return ( q, b)
41
38
}
42
- #else
43
- switch self {
44
- case . free: return ( nil , _dispatch_data_destructor_free ( ) )
45
- case . custom( let q, let b) : return ( q, b)
46
- }
47
- #endif
48
39
}
49
40
}
50
41
#endif
@@ -279,10 +270,8 @@ internal func _swift_dispatch_data_empty() -> dispatch_data_t
279
270
@_silgen_name ( " _swift_dispatch_data_destructor_free " )
280
271
internal func _dispatch_data_destruct or_free( ) -> _DispatchBlock
281
272
282
- #if HAVE_MACH
283
273
@_silgen_name ( " _swift_dispatch_data_destructor_munmap " )
284
274
internal func _dispatch_data_destruct or_munmap( ) -> _DispatchBlock
285
- #endif
286
275
287
276
@_silgen_name ( " _swift_dispatch_data_destructor_default " )
288
277
internal func _dispatch_data_destruct or_default( ) -> _DispatchBlock
Original file line number Diff line number Diff line change @@ -93,13 +93,11 @@ _swift_dispatch_data_destructor_free(void) {
93
93
return _dispatch_data_destructor_free;
94
94
}
95
95
96
- #if HAVE_MACH
97
96
SWIFT_CC (swift) DISPATCH_RUNTIME_STDLIB_INTERFACE
98
97
extern "C" dispatch_block_t
99
98
_swift_dispatch_data_destructor_munmap(void ) {
100
99
return _dispatch_data_destructor_munmap;
101
100
}
102
- #endif
103
101
104
102
SWIFT_CC (swift) DISPATCH_RUNTIME_STDLIB_INTERFACE
105
103
extern "C" dispatch_block_t
You can’t perform that action at this time.
0 commit comments