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 28 matching lines...) Expand all Loading... |
39 // | 39 // |
40 // It is preferred to use Alloc<T>() instead, as that function can | 40 // It is preferred to use Alloc<T>() instead, as that function can |
41 // check for integer overflow. If you use AllocUnsafe, you are | 41 // check for integer overflow. If you use AllocUnsafe, you are |
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 // TODO(zra): Remove these calls and replace them with calls to OS::SCreate |
| 50 // and OS::VSCreate. |
| 51 // These calls are deprecated. Do not add further calls to these functions. |
| 52 // instead use OS::SCreate and OS::VSCreate. |
49 // Make a zone-allocated string based on printf format and args. | 53 // Make a zone-allocated string based on printf format and args. |
50 char* PrintToString(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); | 54 char* PrintToString(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); |
51 | |
52 char* VPrint(const char* format, va_list args); | 55 char* VPrint(const char* format, va_list args); |
53 | 56 |
54 // Compute the total size of this zone. This includes wasted space that is | 57 // Compute the total size of this zone. This includes wasted space that is |
55 // due to internal fragmentation in the segments. | 58 // due to internal fragmentation in the segments. |
56 intptr_t SizeInBytes() const; | 59 intptr_t SizeInBytes() const; |
57 | 60 |
58 // Structure for managing handles allocation. | 61 // Structure for managing handles allocation. |
59 VMHandles* handles() { return &handles_; } | 62 VMHandles* handles() { return &handles_; } |
60 | 63 |
61 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 64 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 memmove(reinterpret_cast<void*>(new_data), | 286 memmove(reinterpret_cast<void*>(new_data), |
284 reinterpret_cast<void*>(old_data), | 287 reinterpret_cast<void*>(old_data), |
285 old_len * kElementSize); | 288 old_len * kElementSize); |
286 } | 289 } |
287 return new_data; | 290 return new_data; |
288 } | 291 } |
289 | 292 |
290 } // namespace dart | 293 } // namespace dart |
291 | 294 |
292 #endif // VM_ZONE_H_ | 295 #endif // VM_ZONE_H_ |
OLD | NEW |