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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // responsible for avoiding integer overflow yourself. | 42 // responsible for avoiding integer overflow yourself. |
43 inline uword AllocUnsafe(intptr_t size); | 43 inline uword AllocUnsafe(intptr_t size); |
44 | 44 |
45 | 45 |
46 // Make a copy of the string in the zone allocated area. | 46 // Make a copy of the string in the zone allocated area. |
47 char* MakeCopyOfString(const char* str); | 47 char* MakeCopyOfString(const char* str); |
48 | 48 |
49 // Make a zone-allocated string based on printf format and args. | 49 // Make a zone-allocated string based on printf format and args. |
50 char* PrintToString(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); | 50 char* PrintToString(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); |
51 | 51 |
| 52 char* VPrint(const char* format, va_list args); |
| 53 |
52 // Compute the total size of this zone. This includes wasted space that is | 54 // Compute the total size of this zone. This includes wasted space that is |
53 // due to internal fragmentation in the segments. | 55 // due to internal fragmentation in the segments. |
54 intptr_t SizeInBytes() const; | 56 intptr_t SizeInBytes() const; |
55 | 57 |
56 // Structure for managing handles allocation. | 58 // Structure for managing handles allocation. |
57 VMHandles* handles() { return &handles_; } | 59 VMHandles* handles() { return &handles_; } |
58 | 60 |
59 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 61 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
60 | 62 |
61 private: | 63 private: |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 memmove(reinterpret_cast<void*>(new_data), | 293 memmove(reinterpret_cast<void*>(new_data), |
292 reinterpret_cast<void*>(old_data), | 294 reinterpret_cast<void*>(old_data), |
293 old_len * kElementSize); | 295 old_len * kElementSize); |
294 } | 296 } |
295 return new_data; | 297 return new_data; |
296 } | 298 } |
297 | 299 |
298 } // namespace dart | 300 } // namespace dart |
299 | 301 |
300 #endif // VM_ZONE_H_ | 302 #endif // VM_ZONE_H_ |
OLD | NEW |