Skip to content

Commit 8a5b527

Browse files
committed
Re-enable const variant for PageTable::new
1 parent 8f9cb5c commit 8a5b527

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/structures/paging/page_table.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,16 @@ pub struct PageTable {
185185

186186
impl PageTable {
187187
/// Creates an empty page table.
188+
#[cfg(feature = "const_fn")]
189+
#[inline]
190+
pub const fn new() -> Self {
191+
const EMPTY: PageTableEntry = PageTableEntry::new();
192+
PageTable {
193+
entries: [EMPTY; ENTRY_COUNT],
194+
}
195+
}
196+
197+
#[cfg(not(feature = "const_fn"))]
188198
#[inline]
189199
pub fn new() -> Self {
190200
const EMPTY: PageTableEntry = PageTableEntry::new();

0 commit comments

Comments
 (0)