File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ impl<P: Plan> MallocAPI<P> {
54
54
pub unsafe fn malloc_size ( & self , ptr : Address ) -> usize {
55
55
let ptr = Address :: from ( ptr) ;
56
56
#[ cfg( target_os = "macos" ) ]
57
- if Self :: is_in_mallockit_heap ( ptr. into ( ) ) {
57
+ if ! Self :: is_in_mallockit_heap ( ptr. into ( ) ) {
58
58
return crate :: util:: macos_malloc_zone:: external_memory_size ( ptr) ;
59
59
}
60
60
P :: get_layout ( ptr) . size ( )
@@ -85,7 +85,7 @@ impl<P: Plan> MallocAPI<P> {
85
85
return ;
86
86
}
87
87
#[ cfg( target_os = "macos" ) ]
88
- if Self :: is_in_mallockit_heap ( ptr. into ( ) ) {
88
+ if ! Self :: is_in_mallockit_heap ( ptr. into ( ) ) {
89
89
return ;
90
90
}
91
91
self . mutator ( ) . dealloc ( ptr. into ( ) ) ;
@@ -108,7 +108,7 @@ impl<P: Plan> MallocAPI<P> {
108
108
let new_size = Self :: align_up ( new_size, Self :: MIN_ALIGNMENT ) ;
109
109
110
110
#[ cfg( target_os = "macos" ) ]
111
- if Self :: is_in_mallockit_heap ( ptr. into ( ) ) {
111
+ if ! Self :: is_in_mallockit_heap ( ptr. into ( ) ) {
112
112
let ptr = Address :: from ( ptr) ;
113
113
let old_size = crate :: util:: macos_malloc_zone:: external_memory_size ( ptr) ;
114
114
let new_layout =
Original file line number Diff line number Diff line change @@ -91,6 +91,10 @@ pub trait TLS: Sized {
91
91
}
92
92
}
93
93
94
+ impl TLS for u8 {
95
+ const NEW : Self = 0 ;
96
+ }
97
+
94
98
#[ cfg( target_os = "macos" ) ]
95
99
mod macos_tls {
96
100
use spin:: { mutex:: Mutex , Yield } ;
@@ -111,9 +115,6 @@ mod macos_tls {
111
115
#[ cfg( test) ]
112
116
#[ no_mangle]
113
117
extern "C" fn mallockit_initialize_macos_tls ( ) -> * mut u8 {
114
- impl TLS for u8 {
115
- const NEW : Self = 0 ;
116
- }
117
118
get_tls :: < u8 > ( )
118
119
}
119
120
You can’t perform that action at this time.
0 commit comments