@SCJAllowed public interface AllocationContext
IllegalThreadStateException
(cf. SCJ Draft D.1.1 INTERFACE AllocationContext) is not included,
since only infrastructure can invoke enter methods ThrowBoundaryError is not included.
It must be the responsibility of the exception handlers for
enter methods to make a local copy of the exception
before propagating it. newArray and
newInstance be SCJAllowed. Should they be there at all?| Modifier and Type | Method and Description |
|---|---|
void |
executeInArea(java.lang.Runnable logic)
Executes some logic with this memory area as the default allocation context.
|
long |
memoryConsumed()
Gets the amount of allocated memory in this memory area.
|
long |
memoryRemaining()
Gets the amount of memory available for allocation in this memory area.
|
java.lang.Object |
newArray(java.lang.Class type,
int number)
Creates a new array of the given type in this memory area.
|
java.lang.Object |
newInstance(java.lang.Class type)
Creates a new instance of a class in this memory area using its default constructor.
|
long |
size()
Gets the size of this memory area.
|
@SCJAllowed(value=INFRASTRUCTURE) void executeInArea(java.lang.Runnable logic) throws java.lang.IllegalArgumentException
logic - is the runnable object whose run() method should be executed in this memory area.java.lang.IllegalArgumentException - Thrown if logic is null.@SCJAllowed long memoryConsumed()
@SCJAllowed long memoryRemaining()
@SCJAllowed(value=INFRASTRUCTURE) java.lang.Object newArray(java.lang.Class type, int number) throws java.lang.IllegalArgumentException, java.lang.OutOfMemoryError
type - is the class of object this array should holdnumber - is the number of elements the array should have.type and size number.java.lang.IllegalArgumentException - Thrown
when number is negative or type is nulljava.lang.OutOfMemoryError - Thrown when there is not enough memory left.@SCJAllowed(value=INFRASTRUCTURE) java.lang.Object newInstance(java.lang.Class type) throws java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.OutOfMemoryError
type - is the class of object to be createdjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.OutOfMemoryError - Thrown when there is not enough memory left.@SCJAllowed long size()