From 6b98b6afea6e790abe738a67aa28bab54c91afe0 Mon Sep 17 00:00:00 2001 From: Nathan Ringo Date: Sun, 1 Sep 2024 18:34:49 -0500 Subject: Fix Clippy lints. --- crates/alloc_physmem_free_list/src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'crates/alloc_physmem_free_list/src/lib.rs') diff --git a/crates/alloc_physmem_free_list/src/lib.rs b/crates/alloc_physmem_free_list/src/lib.rs index f99b30f..0540672 100644 --- a/crates/alloc_physmem_free_list/src/lib.rs +++ b/crates/alloc_physmem_free_list/src/lib.rs @@ -43,6 +43,10 @@ impl<'allocator, const PAGE_SIZE: usize> FreeListAllocator<'allocator, PAGE_SIZE /// Obviously, this is unsound to call while the previous allocation is alive. It is also /// unsound to split any nodes after calling this, since splitting the node that was allocated /// into might write the new node's metadata into that allocation. + /// + /// # Safety + /// + /// - Only one allocation returned by this method may be live. pub unsafe fn allocate_without_always_removing_the_node( &mut self, layout: Layout, @@ -186,6 +190,12 @@ impl<'allocator, const PAGE_SIZE: usize> fmt::Debug for FreeListAllocator<'alloc } } +impl<'allocator, const PAGE_SIZE: usize> Default for FreeListAllocator<'allocator, PAGE_SIZE> { + fn default() -> FreeListAllocator<'allocator, PAGE_SIZE> { + FreeListAllocator::new() + } +} + /// A pointer to a page range, which start with a header in the first page. /// /// # Safety -- cgit v1.2.3