mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 20:47:46 +00:00
improve memory usage estimation
This commit is contained in:
parent
484558e37d
commit
dc5bd9f0be
1 changed files with 3 additions and 1 deletions
|
@ -281,7 +281,9 @@ pub struct Line {
|
|||
|
||||
impl Line {
|
||||
pub fn estimate_size(&self) -> usize {
|
||||
self.line.capacity() + self.selections.capacity() * std::mem::size_of::<Selection>()
|
||||
self.line.capacity()
|
||||
+ self.selections.capacity() * std::mem::size_of::<Selection>()
|
||||
+ std::mem::size_of::<Self>()
|
||||
}
|
||||
|
||||
pub fn new(line: String, settings: &GlobalSettings) -> Self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue