Skip to content

Commit

Permalink
feat: add Memory::shrink_to_fit (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Sep 12, 2022
1 parent 46fa92e commit aa39d64
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/revm/src/interpreter/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ impl Memory {
&self.data
}

/// Shrinks the capacity of the data buffer as much as possible.
pub fn shrink_to_fit(&mut self) {
self.data.shrink_to_fit()
}

/// Resize the memory. asume that we already checked if
/// we have enought gas to resize this vector and that we made new_size as multiply of 32
pub fn resize(&mut self, new_size: usize) {
Expand Down

0 comments on commit aa39d64

Please sign in to comment.