Index: runtime/vm/allocation.cc |
=================================================================== |
--- runtime/vm/allocation.cc (revision 36483) |
+++ runtime/vm/allocation.cc (working copy) |
@@ -14,8 +14,8 @@ |
UNREACHABLE(); |
} |
-void* ZoneAllocated::operator new(uword size) { |
- Isolate* isolate = Isolate::Current(); |
+ |
+static void* Allocate(uword size, BaseIsolate* isolate) { |
ASSERT(isolate != NULL); |
ASSERT(isolate->current_zone() != NULL); |
if (size > static_cast<uword>(kIntptrMax)) { |
@@ -24,4 +24,14 @@ |
return reinterpret_cast<void*>(isolate->current_zone()->AllocUnsafe(size)); |
} |
+ |
+void* ZoneAllocated::operator new(uword size) { |
+ return Allocate(size, Isolate::Current()); |
+} |
+ |
+ |
+void* ZoneAllocated::operator new(uword size, BaseIsolate* isolate) { |
+ return Allocate(size, isolate); |
+} |
+ |
} // namespace dart |