Skip to content

Commit

Permalink
Assume pointer is not null in GlobalAlloc::dealloc
Browse files Browse the repository at this point in the history
Signed-off-by: David McNeil <[email protected]>
  • Loading branch information
davidMcneil authored and gnzlbg committed Dec 11, 2019
1 parent 6fa4273 commit d292b38
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

1 comment on commit d292b38

@draft6
Copy link

@draft6 draft6 commented on d292b38 Dec 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gnzlbg @davidMcneil missing semicolon, it is breaking the build

Please sign in to comment.