Skip to content
Snippets Groups Projects
Commit 13c5ed0b authored by Per Lindgren's avatar Per Lindgren
Browse files

polish

parent 83868d29
No related branches found
No related tags found
No related merge requests found
...@@ -138,12 +138,13 @@ where ...@@ -138,12 +138,13 @@ where
Err(Error::Uninitialized) Err(Error::Uninitialized)
} else { } else {
interrupt_free(|| unsafe { interrupt_free(|| unsafe {
let index = *self.head.get_mut_unchecked(); if *self.head.get_mut_unchecked() >= S {
*self.head.get_mut_unchecked() =
*self.free.get_mut_unchecked().get_unchecked(index);
if *self.head.get_mut_unchecked() > S {
Err(Error::OutOfMemory) Err(Error::OutOfMemory)
} else { } else {
let index = *self.head.get_mut_unchecked();
*self.head.get_mut_unchecked() =
*self.free.get_mut_unchecked().get_unchecked(index);
Ok(Box { Ok(Box {
index, index,
allocator: self, allocator: self,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment