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

Unified Diff: runtime/vm/zone.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/zone.h ('k') | runtime/vm/zone_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/zone.cc
===================================================================
--- runtime/vm/zone.cc (revision 10253)
+++ runtime/vm/zone.cc (working copy)
@@ -186,24 +186,12 @@
char* BaseZone::MakeCopyOfString(const char* str) {
intptr_t len = strlen(str) + 1; // '\0'-terminated.
- char* copy = reinterpret_cast<char*>(Allocate(len));
+ char* copy = Alloc<char>(len);
strncpy(copy, str, len);
return copy;
}
-uword BaseZone::Reallocate(uword data, intptr_t old_size, intptr_t new_size) {
- ASSERT(new_size >= 0);
- uword new_data = Allocate(new_size);
- if (data != 0) {
- memmove(reinterpret_cast<void*>(new_data),
- reinterpret_cast<void*>(data),
- Utils::Minimum(old_size, new_size));
- }
- return new_data;
-}
-
-
#if defined(DEBUG)
void BaseZone::DumpZoneSizes() {
intptr_t size = 0;
@@ -250,7 +238,7 @@
intptr_t len = OS::VSNPrint(NULL, 0, format, args);
va_end(args);
- char* buffer = reinterpret_cast<char*>(Allocate(len + 1));
+ char* buffer = Alloc<char>(len + 1);
va_list args2;
va_start(args2, format);
OS::VSNPrint(buffer, (len + 1), format, args2);
« no previous file with comments | « runtime/vm/zone.h ('k') | runtime/vm/zone_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698