Interface IVirtualMemoryShim

All Superinterfaces:
IVirtualMemory

public interface IVirtualMemoryShim extends IVirtualMemory
A shim is a VM object wrapping another virtual memory, in order to allow temporary write modifications.
  • Method Details

    • getUnderlyingMemory

      IVirtualMemory getUnderlyingMemory()
      Retrieve the underlying VM wrapped by the shim.
      Returns:
    • commitChanges

      int commitChanges(boolean allowPageReplacement, boolean allowPageCreation, boolean allowPageRemoval)
      Commit the modifications onto the underlying VM. Memory writes, page allocations and deletions will be applied to the wrapped virtual memory object.
      Parameters:
      allowPageReplacement -
      allowPageCreation -
      allowPageRemoval -
      Returns:
      the numbers of pages committed
    • commitChanges

      default int commitChanges()
      Commit the modifications onto the underlying VM. Memory writes, page allocations and deletions will be applied to the wrapped virtual memory object.
      Returns:
      the numbers of pages committed
    • getChanges

      MemoryChanges getChanges(boolean collectWrittenPages, boolean collectCreatedPages)
      Collect the changes made between the original memory and the current shim state.
      Parameters:
      collectWrittenPages - true to collect pages that already existed and were modified
      collectCreatedPages - true to collect pages that did not exist and were created
      Returns:
      a diff
    • getChanges

      default MemoryChanges getChanges()
      Collect the changes made between the original memory and the current shim state.
      Returns:
      a diff
    • duplicate

      IVirtualMemoryShim duplicate()
      Description copied from interface: IVirtualMemory
      Make a deep copy of this virtual memory.

      Implementation note: the resulting object may not be of the same type as the source (this) object.

      Specified by:
      duplicate in interface IVirtualMemory
      Returns:
      a new memory object
    • duplicate

      IVirtualMemory duplicate(boolean fullDuplication)
      Duplicate with options.
      Parameters:
      fullDuplication - if false, duplicate the shim only (same as duplicate()); else, a full non-shim VM is created, no longer dependent on some underlying VM
      Returns:
      a duplicated VM