Class MemoryAnnotations

java.lang.Object
net.emustudio.emulib.application.annotations.MemoryAnnotations

@ThreadSafe public final class MemoryAnnotations extends Object
Thread-safe live annotations at CPU-visible addresses.
  • Constructor Details

    • MemoryAnnotations

      public MemoryAnnotations()
  • Method Details

    • revision

      public long revision()
    • get

      public MemoryAnnotations.Entry get(long ownerId, long entryId)
    • at

      public List<MemoryAnnotations.Entry> at(int address)
      Returns current entries covering the given address.
    • all

      Returns all entries currently in the engine.
    • put

      public void put(MemoryAnnotations.Entry entry)
    • remove

      public void remove(long ownerId, long entryId)
    • replaceOwner

      public void replaceOwner(long ownerId, Collection<MemoryAnnotations.Entry> replacement)
      Replaces all entries for an owner in one atomic update.
    • compareAndReplaceOwner

      public boolean compareAndReplaceOwner(long expected, long ownerId, Collection<MemoryAnnotations.Entry> replacement)
      Replaces an owner's entries only if the engine revision is still current.
    • clearOwner

      public void clearOwner(long ownerId)
    • addListener

      public void addListener(Runnable listener)
    • removeListener

      public void removeListener(Runnable listener)
    • ifRevision

      public boolean ifRevision(long expected, Runnable action)
      Runs an action while updates are excluded, if the expected revision is still current.