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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 | 51 |
52 // Compute the total size of this zone. This includes wasted space that is | 52 // Compute the total size of this zone. This includes wasted space that is |
53 // due to internal fragmentation in the segments. | 53 // due to internal fragmentation in the segments. |
54 intptr_t SizeInBytes() const; | 54 intptr_t SizeInBytes() const; |
55 | 55 |
56 // Structure for managing handles allocation. | 56 // Structure for managing handles allocation. |
57 VMHandles* handles() { return &handles_; } | 57 VMHandles* handles() { return &handles_; } |
58 | 58 |
59 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 59 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
60 | 60 |
61 static Zone* Current(); | |
Ivan Posva
2015/01/22 01:26:44
I don't think this adds much.
koda
2015/01/22 02:01:00
Done.
| |
62 | |
61 private: | 63 private: |
62 Zone() | 64 Zone() |
63 : initial_buffer_(buffer_, kInitialChunkSize), | 65 : initial_buffer_(buffer_, kInitialChunkSize), |
64 position_(initial_buffer_.start()), | 66 position_(initial_buffer_.start()), |
65 limit_(initial_buffer_.end()), | 67 limit_(initial_buffer_.end()), |
66 head_(NULL), | 68 head_(NULL), |
67 large_segments_(NULL), | 69 large_segments_(NULL), |
68 handles_(), | 70 handles_(), |
69 previous_(NULL) { | 71 previous_(NULL) { |
70 ASSERT(Utils::IsAligned(position_, kAlignment)); | 72 ASSERT(Utils::IsAligned(position_, kAlignment)); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
285 memmove(reinterpret_cast<void*>(new_data), | 287 memmove(reinterpret_cast<void*>(new_data), |
286 reinterpret_cast<void*>(old_data), | 288 reinterpret_cast<void*>(old_data), |
287 old_len * kElementSize); | 289 old_len * kElementSize); |
288 } | 290 } |
289 return new_data; | 291 return new_data; |
290 } | 292 } |
291 | 293 |
292 } // namespace dart | 294 } // namespace dart |
293 | 295 |
294 #endif // VM_ZONE_H_ | 296 #endif // VM_ZONE_H_ |
OLD | NEW |