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

Unified Diff: runtime/vm/zone.h

Issue 850473002: MallocGrowableArray (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/growable_array_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/zone.h
===================================================================
--- runtime/vm/zone.h (revision 42760)
+++ runtime/vm/zone.h (working copy)
@@ -112,6 +112,15 @@
// Delete all objects and free all memory allocated in the zone.
void DeleteAll();
+ // Does not actually free any memory. Enables templated containers like
+ // BaseGrowableArray to use different allocators.
+ template <class ElementType>
+ void Free(ElementType* old_array, intptr_t len) {
+#ifdef DEBUG
+ memset(old_array, kZapUninitializedByte, len * sizeof(ElementType));
+#endif
+ }
+
#if defined(DEBUG)
// Dump the current allocated sizes in the zone object.
void DumpZoneSizes();
@@ -149,7 +158,8 @@
friend class StackZone;
friend class ApiZone;
- template<typename T, typename B> friend class BaseGrowableArray;
+ template<typename T, typename B, typename Allocator>
+ friend class BaseGrowableArray;
DISALLOW_COPY_AND_ASSIGN(Zone);
};
« no previous file with comments | « runtime/vm/growable_array_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698