Skip to content

Commit

Permalink
alloc: align with AllocRef trait changes in nightly
Browse files Browse the repository at this point in the history
Needed since rust-lang/rust#76993

Signed-off-by: Alex James <[email protected]>
  • Loading branch information
al3xtjames authored and dvdhrm committed Oct 1, 2020
1 parent 0cac105 commit 58c7085
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl Allocator {

unsafe impl core::alloc::AllocRef for Allocator {
fn alloc(
&mut self,
&self,
layout: core::alloc::Layout,
) -> Result<core::ptr::NonNull<[u8]>, core::alloc::AllocErr> {
// We forward the allocation request to `AllocatePool()`. This takes the memory-type and
Expand Down Expand Up @@ -165,7 +165,7 @@ unsafe impl core::alloc::AllocRef for Allocator {
).unwrap())
}

unsafe fn dealloc(&mut self, ptr: core::ptr::NonNull<u8>, layout: core::alloc::Layout) {
unsafe fn dealloc(&self, ptr: core::ptr::NonNull<u8>, layout: core::alloc::Layout) {
if layout.size() != 0 {
// The spec allows returning errors from `FreePool()`. However, it
// must serve any valid requests. Only `INVALID_PARAMETER` is
Expand Down

0 comments on commit 58c7085

Please sign in to comment.