Skip to content

Commit

Permalink
phil-opp/blog_os#1307: add .empty() method
Browse files Browse the repository at this point in the history
  • Loading branch information
kennystrawnmusic committed Mar 30, 2024
1 parent 06eddec commit 476814c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ impl LazyHeap {
Self(Lazy::new(init))
}

/// Create a new `LazyHeap` with the default initialization function.
pub const fn empty() -> Self {
Self(Lazy::new(|| LockedHeap::empty()))
}

/// Initialize the heap with the given range.
pub fn init(&self, begin: usize, len: usize) {
unsafe {
Expand Down

0 comments on commit 476814c

Please sign in to comment.