Assume pointer is not null in GlobalAlloc::dealloc
Signed-off-by: David McNeil <mcneil.david2@gmail.com>
This commit is contained in:
parent
6fa4273d50
commit
d292b3879c
|
@ -122,6 +122,7 @@ unsafe impl GlobalAlloc for Jemalloc {
|
|||
|
||||
#[inline]
|
||||
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
|
||||
assume!(!ptr.is_null())
|
||||
assume!(layout.size() != 0);
|
||||
let flags = layout_to_flags(layout.align(), layout.size());
|
||||
ffi::sdallocx(ptr as *mut c_void, layout.size(), flags)
|
||||
|
|
Loading…
Reference in New Issue