We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a71d6cb + 81600c3 commit 8aa1f64Copy full SHA for 8aa1f64
src/lib.rs
@@ -29,6 +29,18 @@ impl Heap {
29
}
30
31
32
+ /// Initializes an empty heap
33
+ ///
34
+ /// # Unsafety
35
36
+ /// This function must be called at most once and must only be used on an
37
+ /// empty heap.
38
+ pub unsafe fn init(&mut self, heap_bottom: usize, heap_size: usize) {
39
+ self.bottom = heap_bottom;
40
+ self.size = heap_size;
41
+ self.holes = HoleList::new(heap_bottom, heap_size);
42
+ }
43
+
44
/// Creates a new heap with the given `bottom` and `size`. The bottom address must be valid
45
/// and the memory in the `[heap_bottom, heap_bottom + heap_size)` range must not be used for
46
/// anything else. This function is unsafe because it can cause undefined behavior if the
0 commit comments