This public accessible function can cause memory risk since it does not check the input address, which violates the rules specified in https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html.
|
pub fn dealloc(p: *mut u8, layout: Layout) { |
|
unsafe { HUGEPAGE_ALLOCATOR.dealloc(p, layout) } |
|
} |
Suggestion:
Consider to make it unsafe
This public accessible function can cause memory risk since it does not check the input address, which violates the rules specified in https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html.
hugepage-rs/src/lib.rs
Lines 68 to 70 in 403f5de
Suggestion:
Consider to make it unsafe