@@ -136,8 +136,8 @@ pub(crate) extern "C" fn __sys_malloc(size: usize, align: usize) -> *mut u8 {
136
136
let ptr = unsafe { ALLOCATOR . alloc ( layout) } ;
137
137
138
138
trace ! (
139
- "__sys_malloc: allocate memory at {:#x } (size {:#x}, align {:#x})" ,
140
- ptr as usize ,
139
+ "__sys_malloc: allocate memory at {:p } (size {:#x}, align {:#x})" ,
140
+ ptr,
141
141
size,
142
142
align
143
143
) ;
@@ -175,8 +175,8 @@ pub(crate) extern "C" fn __sys_realloc(
175
175
let layout_res = Layout :: from_size_align ( size, align) ;
176
176
if layout_res. is_err ( ) || size == 0 || new_size == 0 {
177
177
warn ! (
178
- "__sys_realloc called with ptr {:#x }, size {:#x}, align {:#x}, new_size {:#x} is an invalid layout!" ,
179
- ptr as usize , size, align, new_size
178
+ "__sys_realloc called with ptr {:p }, size {:#x}, align {:#x}, new_size {:#x} is an invalid layout!" ,
179
+ ptr, size, align, new_size
180
180
) ;
181
181
return core:: ptr:: null :: < * mut u8 > ( ) as * mut u8 ;
182
182
}
@@ -185,14 +185,14 @@ pub(crate) extern "C" fn __sys_realloc(
185
185
186
186
if new_ptr. is_null ( ) {
187
187
debug ! (
188
- "__sys_realloc failed to resize ptr {:#x } with size {:#x}, align {:#x}, new_size {:#x} !" ,
189
- ptr as usize , size, align, new_size
188
+ "__sys_realloc failed to resize ptr {:p } with size {:#x}, align {:#x}, new_size {:#x} !" ,
189
+ ptr, size, align, new_size
190
190
) ;
191
191
} else {
192
192
trace ! (
193
- "__sys_realloc: resized memory at {:#x }, new address {:#x }" ,
194
- ptr as usize ,
195
- new_ptr as usize
193
+ "__sys_realloc: resized memory at {:p }, new address {:p }" ,
194
+ ptr,
195
+ new_ptr
196
196
) ;
197
197
}
198
198
new_ptr
@@ -222,8 +222,8 @@ pub(crate) extern "C" fn __sys_free(ptr: *mut u8, size: usize, align: usize) {
222
222
debug_assert_ne ! ( size, 0 , "__sys_free error: size cannot be 0" ) ;
223
223
} else {
224
224
trace ! (
225
- "sys_free: deallocate memory at {:#x } (size {:#x})" ,
226
- ptr as usize ,
225
+ "sys_free: deallocate memory at {:p } (size {:#x})" ,
226
+ ptr,
227
227
size
228
228
) ;
229
229
}
0 commit comments