OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_ZONE_H_ | 5 #ifndef VM_ZONE_H_ |
6 #define VM_ZONE_H_ | 6 #define VM_ZONE_H_ |
7 | 7 |
8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
10 #include "vm/handles.h" | 10 #include "vm/handles.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 116 |
117 // Compute the total size of this zone. This includes wasted space that is | 117 // Compute the total size of this zone. This includes wasted space that is |
118 // due to internal fragmentation in the segments. | 118 // due to internal fragmentation in the segments. |
119 intptr_t SizeInBytes() const { return zone_.SizeInBytes(); } | 119 intptr_t SizeInBytes() const { return zone_.SizeInBytes(); } |
120 | 120 |
121 // Make a copy of the string in the zone allocated area. | 121 // Make a copy of the string in the zone allocated area. |
122 char* MakeCopyOfString(const char* str) { | 122 char* MakeCopyOfString(const char* str) { |
123 return zone_.MakeCopyOfString(str); | 123 return zone_.MakeCopyOfString(str); |
124 } | 124 } |
125 | 125 |
| 126 // Make a zone-allocated string based on printf format and args. |
| 127 char* PrintToString(const char* format, ...); |
| 128 |
126 VMHandles* handles() { return &handles_; } | 129 VMHandles* handles() { return &handles_; } |
127 | 130 |
128 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 131 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
129 | 132 |
130 private: | 133 private: |
131 BaseZone* GetBaseZone() { return &zone_; } | 134 BaseZone* GetBaseZone() { return &zone_; } |
132 | 135 |
133 BaseZone zone_; | 136 BaseZone zone_; |
134 | 137 |
135 // Structure for managing handles allocation. | 138 // Structure for managing handles allocation. |
(...skipping 26 matching lines...) Expand all Loading... |
162 } | 165 } |
163 | 166 |
164 // Check that the result has the proper alignment and return it. | 167 // Check that the result has the proper alignment and return it. |
165 ASSERT(Utils::IsAligned(result, kAlignment)); | 168 ASSERT(Utils::IsAligned(result, kAlignment)); |
166 return result; | 169 return result; |
167 } | 170 } |
168 | 171 |
169 } // namespace dart | 172 } // namespace dart |
170 | 173 |
171 #endif // VM_ZONE_H_ | 174 #endif // VM_ZONE_H_ |
OLD | NEW |