-
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.
* feat(kernel/markov): add markov and markov state * feat(kernel/memstat): add memory stats gathering * refactor(kernel/utils): add bytes to kb conversion function * feat(kernel/state): implement readahead * refactor(kernel/memstat): clean up the code * refactor(kernel/state): use Default instead of manually filling up fields * perf(kernel): use rayon to speed up routines * feat(kernel/map): add set_block method * feat(kernel/utils): add readahead helper function * refactor(kernel/state): use HashSet instead of BTreeSet * refactor(kernel/memstat): rearrange method chain calls for better clarity * refactor(kernel/state): move logging within conditional check
- Loading branch information
1 parent
4b5878d
commit 940980d
Showing
13 changed files
with
506 additions
and
55 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use bitflags::bitflags; | ||
|
||
bitflags! { | ||
#[repr(transparent)] | ||
#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, PartialOrd, Ord)] | ||
pub struct MarkovState: u8 { | ||
// avoiding zero-bit flag since it is always contained, but is never | ||
// intersected | ||
const NeitherRunning = 0b001; | ||
const ExeARunning = 0b010; | ||
const ExeBRunning = 0b100; | ||
const BothRunning = 0b110; | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
use pretty_assertions::assert_eq; | ||
|
||
#[test] | ||
fn test_markov_state_flags() { | ||
assert_eq!( | ||
MarkovState::BothRunning, | ||
MarkovState::ExeARunning | MarkovState::ExeBRunning | ||
); | ||
assert_eq!( | ||
MarkovState::BothRunning | MarkovState::ExeARunning, | ||
MarkovState::BothRunning, | ||
); | ||
} | ||
} |
Oops, something went wrong.