-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
100 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
//! This module contains the [Page] type as well as associated page parameterization constants. | ||
/// An index of a [Page] within a [TrieMemory] structure. | ||
pub(crate) type PageIndex = u64; | ||
/// An index of a [Page] within an [Address]. | ||
/// | ||
/// [Address]: super::Address | ||
pub type PageIndex = u64; | ||
|
||
/// A page of memory, representing [PAGE_SIZE] bytes of data. | ||
pub(crate) type Page = [u8; PAGE_SIZE]; | ||
pub type Page = [u8; PAGE_SIZE]; | ||
|
||
pub(crate) const PAGE_ADDRESS_SIZE: usize = 12; | ||
pub(crate) const PAGE_SIZE: usize = 1 << PAGE_ADDRESS_SIZE; | ||
pub(crate) const PAGE_ADDRESS_MASK: usize = PAGE_SIZE - 1; | ||
/// The size of a page address in bits. | ||
pub const PAGE_ADDRESS_SIZE: usize = 12; | ||
|
||
/// The size of a [Page] in bytes. | ||
pub const PAGE_SIZE: usize = 1 << PAGE_ADDRESS_SIZE; | ||
|
||
/// The mask to apply to an [Address] to obtain the page address. | ||
/// | ||
/// [Address]: super::Address | ||
pub const PAGE_ADDRESS_MASK: usize = PAGE_SIZE - 1; | ||
|
||
/// An empty page of memory, zeroed out. | ||
pub(crate) const EMPTY_PAGE: Page = [0u8; PAGE_SIZE]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.