public class RecordingStack
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private boolean[] |
indirect
Stores the whether indirect group recording is enabled for the given
group.
|
private long[] |
memAlloc
Stores the accumulated memory allocations per entered recording group.
|
private int[] |
recId
Stores the recording ids used for the actually entered recording groups.
|
private int |
size
Stores the number of elements in
memAlloc. |
private static int |
STACK_INCREMENT
Defines the stack increment in case that there is no more space and also
the initial stack size.
|
private int[] |
unallocationId
Stores the recording ids for unallocation monitoring.
|
private int |
unallocationIdSize
Stores the number of elements in
unallocationId. |
| Constructor and Description |
|---|
RecordingStack(boolean unalloc)
Creates a boolean stack.
|
RecordingStack(RecordingStack origin)
Creates a stack from the given
origin stack by adding all
elements. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getIndirect(int index)
Returns the indirect group accounting flag at the specified index.
|
long |
getMemAlloc(int index)
Returns the accounted memory allocation at the specified index.
|
int |
getRecId(int index)
Returns the recording id at the specified index.
|
int |
getUnallocationId(int index)
Returns the unallocation id at the specified index.
|
boolean |
isEmpty()
Returns whether the stack is empty.
|
void |
pop()
Pops the top element from the stack.
|
void |
push(int id,
long alloc,
boolean groupIndirect)
Pushes a value on the stack.
|
void |
pushAll(RecordingStack from)
Pushes the entire stack
from. |
void |
recordUnallocation(long tag,
long allocSize)
Records the unallocation data for the given external
tag
of size allocSize. |
void |
recordUnallocation(java.lang.Object allocated,
long allocSize)
Records the unallocation data for the given
allocated object
of size allocSize. |
int |
size()
Returns the number of elements in the stack.
|
long |
top()
Returns the top memory allocation.
|
long |
top(long alloc)
Returns the top element and changes the top value as a side effect.
|
int |
unallocationIdSize()
Returns the size of the unallocation id stack.
|
private static final int STACK_INCREMENT
private long[] memAlloc
size. [performance]private int[] recId
size. [performance]private boolean[] indirect
size.
[performance]private int size
memAlloc.private int[] unallocationId
recId.
The number of elements is unallocationIdSize.private int unallocationIdSize
unallocationId.public RecordingStack(boolean unalloc)
unalloc - whether unallocation information shall be
stored [performance]public RecordingStack(RecordingStack origin)
origin stack by adding all
elements.origin - the stack to take the contents frompublic int size()
public boolean isEmpty()
true if it is empty, false elsepublic void push(int id,
long alloc,
boolean groupIndirect)
id - the recording id of the new element on the topalloc - the memory allocation value to be pushedgroupIndirect - perform deep indirect monitoring (or not)public void pushAll(RecordingStack from)
from.from - the stack to be pushedpublic long top(long alloc)
alloc - the new allocation value on the toppublic long top()
public void pop()
public void recordUnallocation(long tag,
long allocSize)
tag
of size allocSize. This method will take the allocation
mode in indirect as well as the unallocation ids in
unallocationId into account. [native call]tag - an (external) allocation tagallocSize - the allocated memory size of allocatedpublic void recordUnallocation(java.lang.Object allocated,
long allocSize)
allocated object
of size allocSize. This method will take the allocation
mode in indirect as well as the unallocation ids in
unallocationId into account. [Java call]allocated - the allocated objectallocSize - the allocated memory size of allocated,
if the allocation is already recorded, the allocSize
is considered as an increment/decrement to the actual sizepublic int unallocationIdSize()
public int getUnallocationId(int index)
index - the index the id should be returned for
(0 <= index <unallocationIdSize()java.lang.IllegalArgumentException - in case that recId
is nullpublic boolean getIndirect(int index)
index - the index the id should be returned for
(0 <= index <size()public long getMemAlloc(int index)
index - the index the id should be returned for
(0 <= index <size()