1 9 package javolution.realtime; 10 11 18 public final class HeapContext extends Context { 19 20 23 HeapContext() { 24 } 25 26 29 public static void enter() { 30 HeapContext ctx = (HeapContext) push(HEAP_CONTEXT_CLASS); 31 if (ctx == null) { 32 ctx = new HeapContext(); 33 push(ctx); 34 } 35 PoolContext outer = ctx.getOuter().poolContext(); 36 if (outer != null) { 37 outer.setInUsePoolsLocal(false); 38 } 39 } 40 private static final Class HEAP_CONTEXT_CLASS = new HeapContext().getClass(); 41 42 49 public static void exit() { 50 HeapContext ctx = (HeapContext) pop(); 51 PoolContext outer = ctx.getOuter().poolContext(); 52 if (outer != null) { 53 outer.setInUsePoolsLocal(true); 54 } 55 } 56 57 protected void dispose() { 59 } 61 } | Popular Tags |