Assume pointer is not null in GlobalAlloc::dealloc

Signed-off-by: David McNeil <mcneil.david2@gmail.com>
This commit is contained in:
David McNeil 2019-12-11 10:18:16 -05:00 committed by gnzlbg
parent 6fa4273d50
commit d292b3879c
1 changed files with 1 additions and 0 deletions

View File

@ -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)