85
86 public Allocation allocate_expect_success(long words) {
87 Allocation a = allocate(words);
88 if (a.isNull()) {
89 throw new RuntimeException("Allocation failed (" + words + ")");
90 }
91 return a;
92 }
93
94 public void allocate_expect_failure(long words) {
95 Allocation a = allocate(words);
96 if (!a.isNull()) {
97 throw new RuntimeException("Allocation failed (" + words + ")");
98 }
99 }
100
101 boolean isLive() {
102 return arena != 0;
103 }
104
105
106 @Override
107 public String toString() {
108 return "arena=" + arena +
109 ", ceiling=" + allocationCeiling +
110 ", allocatedWords=" + allocatedWords +
111 ", numAllocated=" + numAllocated +
112 ", deallocatedWords=" + deallocatedWords +
113 ", numDeallocated=" + numDeallocated +
114 ", numAllocationFailures=" + numAllocationFailures +
115 '}';
116 }
117
118 }
|
85
86 public Allocation allocate_expect_success(long words) {
87 Allocation a = allocate(words);
88 if (a.isNull()) {
89 throw new RuntimeException("Allocation failed (" + words + ")");
90 }
91 return a;
92 }
93
94 public void allocate_expect_failure(long words) {
95 Allocation a = allocate(words);
96 if (!a.isNull()) {
97 throw new RuntimeException("Allocation failed (" + words + ")");
98 }
99 }
100
101 boolean isLive() {
102 return arena != 0;
103 }
104
105 @Override
106 public String toString() {
107 return "arena=" + arena +
108 ", ceiling=" + allocationCeiling +
109 ", allocatedWords=" + allocatedWords +
110 ", numAllocated=" + numAllocated +
111 ", deallocatedWords=" + deallocatedWords +
112 ", numDeallocated=" + numDeallocated +
113 ", numAllocationFailures=" + numAllocationFailures +
114 '}';
115 }
116
117 }
|