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

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, 4 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/object.cc ('k') | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object_snapshot.cc
===================================================================
--- runtime/vm/raw_object_snapshot.cc (revision 10253)
+++ 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);
}
@@ -1243,7 +1243,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);
@@ -1290,7 +1290,7 @@
length,
is_negative,
reinterpret_cast<void*>(data_start),
- &ZoneAllocator);
+ &BigintAllocator);
bool neg = false;
if (*str == '-') {
neg = true;
@@ -1378,7 +1378,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>();
}
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698