Class MemoryAnnotations
java.lang.Object
net.emustudio.emulib.application.annotations.MemoryAnnotations
Thread-safe live annotations at CPU-visible addresses.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classAn annotation covers the half-open address range [start, end). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(Runnable listener) all()Returns all entries currently in the engine.at(int address) Returns current entries covering the given address.voidclearOwner(long ownerId) booleancompareAndReplaceOwner(long expected, long ownerId, Collection<MemoryAnnotations.Entry> replacement) Replaces an owner's entries only if the engine revision is still current.get(long ownerId, long entryId) booleanifRevision(long expected, Runnable action) Runs an action while updates are excluded, if the expected revision is still current.voidput(MemoryAnnotations.Entry entry) voidremove(long ownerId, long entryId) voidremoveListener(Runnable listener) voidreplaceOwner(long ownerId, Collection<MemoryAnnotations.Entry> replacement) Replaces all entries for an owner in one atomic update.longrevision()
-
Constructor Details
-
MemoryAnnotations
public MemoryAnnotations()
-
-
Method Details
-
revision
public long revision() -
get
-
at
Returns current entries covering the given address. -
all
Returns all entries currently in the engine. -
put
-
remove
public void remove(long ownerId, long entryId) -
replaceOwner
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
-
removeListener
-
ifRevision
Runs an action while updates are excluded, if the expected revision is still current.
-