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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 10836061: Change the zone allocation api. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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
Index: runtime/vm/raw_object_snapshot.cc
===================================================================
--- runtime/vm/raw_object_snapshot.cc (revision 10080)
+++ runtime/vm/raw_object_snapshot.cc (working copy)
@@ -18,9 +18,9 @@
((kind == Snapshot::kFull) ? reader->New##type(len) : type::New(len))
-static uword ZoneAllocator(intptr_t size) {
+static uword BigintAllocator(intptr_t size) {
Zone* zone = Isolate::Current()->current_zone();
- return zone->Allocate(size);
+ return zone->AllocUnsafe(size);
}
@@ -1225,7 +1225,7 @@
// Read in the HexCString representation of the bigint.
intptr_t len = reader->ReadIntptrValue();
- char* str = reinterpret_cast<char*>(ZoneAllocator(len + 1));
+ char* str = Isolate::Current()->current_zone()->Alloc<char>(len + 1);
str[len] = '\0';
reader->ReadBytes(reinterpret_cast<uint8_t*>(str), len);
@@ -1272,7 +1272,7 @@
length,
is_negative,
reinterpret_cast<void*>(data_start),
- &ZoneAllocator);
+ &BigintAllocator);
bool neg = false;
if (*str == '-') {
neg = true;
@@ -1360,7 +1360,8 @@
if (RawObject::IsCanonical(tags)) {
// Set up canonical string object.
ASSERT(reader != NULL);
- CharacterType* ptr = reinterpret_cast<CharacterType*>(ZoneAllocator(len));
+ CharacterType* ptr =
+ Isolate::Current()->current_zone()->Alloc<CharacterType>(len);
for (intptr_t i = 0; i < len; i++) {
ptr[i] = reader->Read<CharacterType>();
}

Powered by Google App Engine
This is Rietveld 408576698