Skip to content

Commit ae08c62

Browse files
committed
Remove dead code
Signed-off-by: Jorge Prendes <[email protected]>
1 parent 5aa5153 commit ae08c62

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

src/hyperlight_host/src/mem/mgr.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -321,21 +321,6 @@ where
321321
Ok(old_rgns - self.mapped_rgns)
322322
}
323323

324-
/// this function pops the last snapshot off the stack and restores the memory to the previous state
325-
/// It should be used when you want to restore the state of the memory to a previous state and do not need to retain that state
326-
/// for example when devolving a sandbox to a previous state.
327-
pub(crate) fn pop_and_restore_state_from_snapshot(&mut self) -> Result<u64> {
328-
let last = self
329-
.snapshots
330-
.try_lock()
331-
.map_err(|e| new_error!("Error locking at {}:{}: {}", file!(), line!(), e))?
332-
.pop();
333-
if last.is_none() {
334-
log_then_return!(NoMemorySnapshot);
335-
}
336-
self.restore_state_from_last_snapshot()
337-
}
338-
339324
/// Sets `addr` to the correct offset in the memory referenced by
340325
/// `shared_mem` to indicate the address of the outb pointer and context
341326
/// for calling outb function

src/hyperlight_host/src/mem/shared_mem_snapshot.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ impl SharedMemorySnapshot {
5353
/// Copy the memory from the internally-stored memory snapshot
5454
/// into the internally-stored `SharedMemory`
5555
#[instrument(err(Debug), skip_all, parent = Span::current(), level= "Trace")]
56-
pub(super) fn restore_from_snapshot<S: SharedMemory>(
57-
&self,
58-
shared_mem: &mut S,
59-
) -> Result<u64> {
56+
pub(super) fn restore_from_snapshot<S: SharedMemory>(&self, shared_mem: &mut S) -> Result<u64> {
6057
shared_mem.with_exclusivity(|e| e.copy_from_slice(self.snapshot.as_slice(), 0))??;
6158
Ok(self.mapped_rgns)
6259
}

0 commit comments

Comments
 (0)