49 }); 50 } 51 52 private static void initialize(TypeDataBase db) { 53 Type type = db.lookupType("EpsilonHeap"); 54 spaceField = type.getAddressField("_space"); 55 virtualSpaceField = type.getField("_virtual_space"); 56 } 57 58 public EpsilonHeap(Address addr) { 59 super(addr); 60 space = new ContiguousSpace(spaceField.getValue(addr)); 61 virtualSpace = new VirtualSpace(addr.addOffsetTo(virtualSpaceField.getOffset())); 62 } 63 64 @Override 65 public CollectedHeapName kind() { 66 return CollectedHeapName.EPSILON; 67 } 68 69 public ContiguousSpace space() { 70 return space; 71 } 72 73 @Override 74 public void printOn(PrintStream tty) { 75 MemRegion mr = reservedRegion(); 76 tty.println("Epsilon heap"); 77 tty.println(" reserved: [" + mr.start() + ", " + mr.end() + "]"); 78 tty.println(" committed: [" + virtualSpace.low() + ", " + virtualSpace.high() + "]"); 79 tty.println(" used: [" + space.bottom() + ", " + space.top() + "]"); 80 } 81 82 } | 49 }); 50 } 51 52 private static void initialize(TypeDataBase db) { 53 Type type = db.lookupType("EpsilonHeap"); 54 spaceField = type.getAddressField("_space"); 55 virtualSpaceField = type.getField("_virtual_space"); 56 } 57 58 public EpsilonHeap(Address addr) { 59 super(addr); 60 space = new ContiguousSpace(spaceField.getValue(addr)); 61 virtualSpace = new VirtualSpace(addr.addOffsetTo(virtualSpaceField.getOffset())); 62 } 63 64 @Override 65 public CollectedHeapName kind() { 66 return CollectedHeapName.EPSILON; 67 } 68 69 @Override 70 public long capacity() { 71 return space.capacity(); 72 } 73 74 @Override 75 public long used() { 76 return space.used(); 77 } 78 79 public ContiguousSpace space() { 80 return space; 81 } 82 83 @Override 84 public void printOn(PrintStream tty) { 85 MemRegion mr = reservedRegion(); 86 tty.println("Epsilon heap"); 87 tty.println(" reserved: [" + mr.start() + ", " + mr.end() + "]"); 88 tty.println(" committed: [" + virtualSpace.low() + ", " + virtualSpace.high() + "]"); 89 tty.println(" used: [" + space.bottom() + ", " + space.top() + "]"); 90 } 91 92 } |