Lecture8
Lecture8
ImmortalMemory.instance().enter(new Runnable()
{
public void run() {
// any memory allocation performed here
// using the allocator will occur in
// Immortal memory
}
} ); see Introduction notes about
anonymous inner classes
With this solution, there is just the initial cost of creating the
produce object (performed in the constructor of
MatrixExample)
Note that the only way to pass parameters to the run
method is via setting attributes of the object (in this case
directly)
{
SizeEstimator s = new SizeEstimator();
s.reserve(javax.realtime.PriorityParameters.class, 1);
System.out.println(“size of PriorityParameters is “
+s.getEstimate());
}