~ren/polymorph-allocator

04961a301bd47b3edb2de880ff3d7a9517d60988 — Lauren Jenkinson 5 months ago 29cfc5d
lib: Change AllocErr to AllocError
1 files changed, 4 insertions(+), 4 deletions(-)

M src/lib.rs
M src/lib.rs => src/lib.rs +4 -4
@@ 7,7 7,7 @@

extern crate alloc;

use alloc::alloc::{AllocErr, Layout};
use alloc::alloc::{AllocError, Layout};
use core::mem::{self, size_of};
use core::ptr::NonNull;



@@ 264,9 264,9 @@ impl Allocator {
    ///
    /// # Errors
    ///
    /// Returns an `AllocErr` if there was not enough free memory to allocate
    /// Returns an `AllocError` if there was not enough free memory to allocate
    /// a region for the requested layout.
    pub fn allocate(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocErr> {
    pub fn allocate(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocError> {
        let mut size = layout.size();
        if size < Self::min_allocation_size() {
            size = Self::min_allocation_size();


@@ 279,7 279,7 @@ impl Allocator {

        // No free regions big enough for this allocation
        if region.is_none() {
            return Err(AllocErr);
            return Err(AllocError);
        }

        // Mark region as used and add data