Skip to content

Commit d6c3ec4

Browse files
committed
Remove dead code
Signed-off-by: Jorge Prendes <[email protected]>
1 parent 0b11c0a commit d6c3ec4

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
@@ -304,21 +304,6 @@ where
304304
snapshot.restore_from_snapshot(&mut self.shared_mem)
305305
}
306306

307-
/// this function pops the last snapshot off the stack and restores the memory to the previous state
308-
/// 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
309-
/// for example when devolving a sandbox to a previous state.
310-
pub(crate) fn pop_and_restore_state_from_snapshot(&mut self) -> Result<()> {
311-
let last = self
312-
.snapshots
313-
.try_lock()
314-
.map_err(|e| new_error!("Error locking at {}:{}: {}", file!(), line!(), e))?
315-
.pop();
316-
if last.is_none() {
317-
log_then_return!(NoMemorySnapshot);
318-
}
319-
self.restore_state_from_last_snapshot()
320-
}
321-
322307
/// Sets `addr` to the correct offset in the memory referenced by
323308
/// `shared_mem` to indicate the address of the outb pointer and context
324309
/// 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
@@ -48,10 +48,7 @@ impl SharedMemorySnapshot {
4848
/// Copy the memory from the internally-stored memory snapshot
4949
/// into the internally-stored `SharedMemory`
5050
#[instrument(err(Debug), skip_all, parent = Span::current(), level= "Trace")]
51-
pub(super) fn restore_from_snapshot<S: SharedMemory>(
52-
&self,
53-
shared_mem: &mut S,
54-
) -> Result<()> {
51+
pub(super) fn restore_from_snapshot<S: SharedMemory>(&self, shared_mem: &mut S) -> Result<()> {
5552
shared_mem.with_exclusivity(|e| e.copy_from_slice(self.snapshot.as_slice(), 0))?
5653
}
5754

0 commit comments

Comments
 (0)