summaryrefslogtreecommitdiff
path: root/crates/alloc_physmem_free_list
diff options
context:
space:
mode:
authorNathan Ringo <nathan@remexre.com>2024-09-01 18:34:49 -0500
committerNathan Ringo <nathan@remexre.com>2024-09-01 18:34:49 -0500
commit6b98b6afea6e790abe738a67aa28bab54c91afe0 (patch)
treebf32c2e35a347795d3a0f8df80792f9df5ec79bc /crates/alloc_physmem_free_list
parent1867170d185c3480542773a74876175e341b91eb (diff)
Fix Clippy lints.
Diffstat (limited to 'crates/alloc_physmem_free_list')
-rw-r--r--crates/alloc_physmem_free_list/src/lib.rs10
1 files changed, 10 insertions, 0 deletions
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