-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement support for changing SHM_SIZE
- Loading branch information
1 parent
11cf327
commit 1510670
Showing
5 changed files
with
45 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from dataclasses import dataclass | ||
|
||
|
||
@dataclass | ||
class Memsize: | ||
""" | ||
A quantity of bytes. | ||
""" | ||
|
||
mebibytes: int | ||
|
||
def as_mb(self) -> str: | ||
"""Value as megabyte string, ending in 'm'""" | ||
mb = int(1.048576 * self.mebibytes) | ||
return f'{mb}m' | ||
|
||
def as_mib(self) -> str: | ||
"""Value as mebibyte string, ending in 'Mi'""" | ||
return f'{self.mebibytes}Mi' |