Skip to content

Commit

Permalink
feat(mapper): expose MapperFlush(All)?::new
Browse files Browse the repository at this point in the history
It looks like there is no way to create an instance of these types.

Fixes: #295
  • Loading branch information
toku-sa-n committed Aug 29, 2021
1 parent f8a3d70 commit 5bd59af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/structures/paging/mapper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ pub struct MapperFlush<S: PageSize>(Page<S>);
impl<S: PageSize> MapperFlush<S> {
/// Create a new flush promise
#[inline]
fn new(page: Page<S>) -> Self {
pub fn new(page: Page<S>) -> Self {
MapperFlush(page)
}

Expand All @@ -403,14 +403,14 @@ impl<S: PageSize> MapperFlush<S> {
/// The old mapping might be still cached in the translation lookaside buffer (TLB), so it needs
/// to be flushed from the TLB before it's accessed. This type is returned from a function that
/// made the change to ensure that the TLB flush is not forgotten.
#[derive(Debug)]
#[derive(Debug, Default)]
#[must_use = "Page Table changes must be flushed or ignored."]
pub struct MapperFlushAll(());

impl MapperFlushAll {
/// Create a new flush promise
#[inline]
fn new() -> Self {
pub fn new() -> Self {
MapperFlushAll(())
}

Expand Down

0 comments on commit 5bd59af

Please sign in to comment.