javax.realtime
Class CTMemory
java.lang.Object
|
+--javax.realtime.MemoryArea
|
+--javax.realtime.ScopedMemory
|
+--javax.realtime.CTMemory
- public class CTMemory
- extends ScopedMemory
CTMemory
represents a constant-sized memory scope.
It uses stack allocation and is very fast and has predictable performance.
Field Summary |
private long |
minimum
This constructs a CTMemory of the appropriate size (the maximum allowed
to be allocated in the scope). |
Method Summary |
void |
done()
Invoke this method when you're finished with the MemoryArea
(could be a finalizer if we had finalizers...) |
private void |
doneNative()
This will actually free the memory (if refcount = 0). |
protected void |
initNative(long sizeInBytes)
Initialize the native component of this MemoryArea
(set up the MemBlock) |
private void |
initNative(long minimum,
long maximum)
|
java.lang.String |
toString()
Returns a representation of this CTMemory object |
Methods inherited from class javax.realtime.ScopedMemory |
checkAccess, checkNewInstance, enter, enter, getMaximumSize, getOuterScope, getPortal, getReferenceCount, join, join, joinAndEnter, joinAndEnter, joinAndEnter, joinAndEnter, setPortal, setupMemBlock |
Methods inherited from class javax.realtime.MemoryArea |
bless, enterMemBlock, executeInArea, exitMemBlock, getMemoryArea, memoryConsumed, memoryRemaining, newArray, newArray, newArray, newArray, newInstance, newInstance, newInstance, newInstance, postSetup, preSetup, registerFinal, shadow, size, startMem, stopMem, throwIllegalAssignmentError |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
minimum
private long minimum
- This constructs a CTMemory of the appropriate size (the maximum allowed
to be allocated in the scope). The performance
hit of allocating a large block of memory is taken when this constructor
is called, or reused after refCount drops to zero.
CTMemory
public CTMemory(long size)
CTMemory
public CTMemory(long minimum,
long maximum)
toString
public java.lang.String toString()
- Returns a representation of this CTMemory object
- Overrides:
toString
in class ScopedMemory
- Returns:
- The string representation.
initNative
protected void initNative(long sizeInBytes)
- Initialize the native component of this MemoryArea
(set up the MemBlock)
- Specified by:
initNative
in class MemoryArea
initNative
private void initNative(long minimum,
long maximum)
done
public void done()
- Invoke this method when you're finished with the MemoryArea
(could be a finalizer if we had finalizers...)
doneNative
private void doneNative()
- This will actually free the memory (if refcount = 0).