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 #include "vm/zone.h" | 5 #include "vm/zone.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
10 #include "vm/handles_impl.h" | 10 #include "vm/handles_impl.h" |
11 #include "vm/heap.h" | 11 #include "vm/heap.h" |
12 #include "vm/isolate.h" | 12 #include "vm/isolate.h" |
13 #include "vm/os.h" | 13 #include "vm/os.h" |
| 14 #include "vm/thread.h" |
14 | 15 |
15 namespace dart { | 16 namespace dart { |
16 | 17 |
17 DEFINE_DEBUG_FLAG(bool, trace_zones, | 18 DEFINE_DEBUG_FLAG(bool, trace_zones, |
18 false, "Traces allocation sizes in the zone."); | 19 false, "Traces allocation sizes in the zone."); |
19 | 20 |
20 | 21 |
21 // Zone segments represent chunks of memory: They have starting | 22 // Zone segments represent chunks of memory: They have starting |
22 // address encoded in the this pointer and a size in bytes. They are | 23 // address encoded in the this pointer and a size in bytes. They are |
23 // chained together to form the backing storage for an expanding zone. | 24 // chained together to form the backing storage for an expanding zone. |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 char* buffer = Alloc<char>(len + 1); | 210 char* buffer = Alloc<char>(len + 1); |
210 va_list args2; | 211 va_list args2; |
211 va_start(args2, format); | 212 va_start(args2, format); |
212 OS::VSNPrint(buffer, (len + 1), format, args2); | 213 OS::VSNPrint(buffer, (len + 1), format, args2); |
213 va_end(args2); | 214 va_end(args2); |
214 | 215 |
215 return buffer; | 216 return buffer; |
216 } | 217 } |
217 | 218 |
218 | 219 |
| 220 Zone* Zone::Current() { |
| 221 return Thread::Current()->current_zone(); |
| 222 } |
| 223 |
219 } // namespace dart | 224 } // namespace dart |
OLD | NEW |