Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: runtime/vm/growable_array.h

Issue 11028145: Changed StackZone and ApiZone to be containers for Zone. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor tweak to use RawError instead of RawObject. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/globals.h ('k') | runtime/vm/handles.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // Defines growable array classes, that differ where they are allocated: 4 // Defines growable array classes, that differ where they are allocated:
5 // - GrowableArray: allocate on stack. 5 // - GrowableArray: allocate on stack.
6 // - ZoneGrowableArray: allocated in the zone. 6 // - ZoneGrowableArray: allocated in the zone.
7 7
8 #ifndef VM_GROWABLE_ARRAY_H_ 8 #ifndef VM_GROWABLE_ARRAY_H_
9 #define VM_GROWABLE_ARRAY_H_ 9 #define VM_GROWABLE_ARRAY_H_
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 length_ = new_length; 116 length_ = new_length;
117 } 117 }
118 118
119 119
120 template<typename T> 120 template<typename T>
121 class GrowableArray : public BaseGrowableArray<T, ValueObject> { 121 class GrowableArray : public BaseGrowableArray<T, ValueObject> {
122 public: 122 public:
123 explicit GrowableArray(int initial_capacity) 123 explicit GrowableArray(int initial_capacity)
124 : BaseGrowableArray<T, ValueObject>( 124 : BaseGrowableArray<T, ValueObject>(
125 initial_capacity, 125 initial_capacity,
126 Isolate::Current()->current_zone()->GetBaseZone()) {} 126 Isolate::Current()->current_zone()) {}
127 GrowableArray() 127 GrowableArray()
128 : BaseGrowableArray<T, ValueObject>( 128 : BaseGrowableArray<T, ValueObject>(
129 Isolate::Current()->current_zone()->GetBaseZone()) {} 129 Isolate::Current()->current_zone()) {}
130 }; 130 };
131 131
132 132
133 template<typename T> 133 template<typename T>
134 class ZoneGrowableArray : public BaseGrowableArray<T, ZoneAllocated> { 134 class ZoneGrowableArray : public BaseGrowableArray<T, ZoneAllocated> {
135 public: 135 public:
136 explicit ZoneGrowableArray(int initial_capacity) 136 explicit ZoneGrowableArray(int initial_capacity)
137 : BaseGrowableArray<T, ZoneAllocated>( 137 : BaseGrowableArray<T, ZoneAllocated>(
138 initial_capacity, 138 initial_capacity,
139 Isolate::Current()->current_zone()->GetBaseZone()) {} 139 Isolate::Current()->current_zone()) {}
140 ZoneGrowableArray() : 140 ZoneGrowableArray() :
141 BaseGrowableArray<T, ZoneAllocated>( 141 BaseGrowableArray<T, ZoneAllocated>(
142 Isolate::Current()->current_zone()->GetBaseZone()) {} 142 Isolate::Current()->current_zone()) {}
143 }; 143 };
144 144
145 } // namespace dart 145 } // namespace dart
146 146
147 #endif // VM_GROWABLE_ARRAY_H_ 147 #endif // VM_GROWABLE_ARRAY_H_
OLDNEW
« no previous file with comments | « runtime/vm/globals.h ('k') | runtime/vm/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698