public final class MemoryTracker
extends java.lang.Object
MemoryTracker
class tracks usage of memory regions.Modifier and Type | Class and Description |
---|---|
static class |
MemoryTracker.Region |
Constructor and Description |
---|
MemoryTracker() |
Modifier and Type | Method and Description |
---|---|
boolean |
isUsed(java.math.BigInteger address)
Checks whether the specified address is location in one
of regions in use.
|
void |
reset() |
java.lang.String |
toString() |
MemoryTracker.Region |
use(java.math.BigInteger startAddress,
java.math.BigInteger endAddress)
Tries to reserve a memory region within the specified address range.
|
public MemoryTracker.Region use(java.math.BigInteger startAddress, java.math.BigInteger endAddress)
startAddress
- Start address of the region.endAddress
- End address of a region (excluded).null
if region is reserved successfully or a overlapping region is the
specified address range is already in use.public boolean isUsed(java.math.BigInteger address)
address
- Address to be checked.true
if the address is within one of the used
regions of false
othwerwise.public void reset()
public java.lang.String toString()
toString
in class java.lang.Object