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 52eac27 + eea4d1c commit 95e5d6cCopy full SHA for 95e5d6c
src/frame.rs
@@ -1,7 +1,6 @@
1
use super::prev_power_of_two;
2
use alloc::collections::BTreeSet;
3
use core::alloc::Layout;
4
-use core::array;
5
use core::cmp::{max, min};
6
use core::ops::Range;
7
@@ -41,9 +40,9 @@ pub struct FrameAllocator<const ORDER: usize = 32> {
41
40
42
impl<const ORDER: usize> FrameAllocator<ORDER> {
43
/// Create an empty frame allocator
44
- pub fn new() -> Self {
+ pub const fn new() -> Self {
45
Self {
46
- free_list: array::from_fn(|_| BTreeSet::default()),
+ free_list: [const { BTreeSet::new() }; ORDER],
47
allocated: 0,
48
total: 0,
49
}
0 commit comments