| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 // Compute the total size of this zone. This includes wasted space that is | 64 // Compute the total size of this zone. This includes wasted space that is |
| 65 // due to internal fragmentation in the segments. | 65 // due to internal fragmentation in the segments. |
| 66 intptr_t SizeInBytes() const; | 66 intptr_t SizeInBytes() const; |
| 67 | 67 |
| 68 // Structure for managing handles allocation. | 68 // Structure for managing handles allocation. |
| 69 VMHandles* handles() { return &handles_; } | 69 VMHandles* handles() { return &handles_; } |
| 70 | 70 |
| 71 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 71 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
| 72 | 72 |
| 73 Zone* previous() const { return previous_; } |
| 74 |
| 73 private: | 75 private: |
| 74 Zone(); | 76 Zone(); |
| 75 ~Zone(); // Delete all memory associated with the zone. | 77 ~Zone(); // Delete all memory associated with the zone. |
| 76 | 78 |
| 77 // All pointers returned from AllocateUnsafe() and New() have this alignment. | 79 // All pointers returned from AllocateUnsafe() and New() have this alignment. |
| 78 static const intptr_t kAlignment = kDoubleSize; | 80 static const intptr_t kAlignment = kDoubleSize; |
| 79 | 81 |
| 80 // Default initial chunk size. | 82 // Default initial chunk size. |
| 81 static const intptr_t kInitialChunkSize = 1 * KB; | 83 static const intptr_t kInitialChunkSize = 1 * KB; |
| 82 | 84 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 memmove(reinterpret_cast<void*>(new_data), | 253 memmove(reinterpret_cast<void*>(new_data), |
| 252 reinterpret_cast<void*>(old_data), | 254 reinterpret_cast<void*>(old_data), |
| 253 old_len * kElementSize); | 255 old_len * kElementSize); |
| 254 } | 256 } |
| 255 return new_data; | 257 return new_data; |
| 256 } | 258 } |
| 257 | 259 |
| 258 } // namespace dart | 260 } // namespace dart |
| 259 | 261 |
| 260 #endif // VM_ZONE_H_ | 262 #endif // VM_ZONE_H_ |
| OLD | NEW |