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

Unified Diff: vm/snapshot.h

Issue 10908185: Do not allocate a buffer of 64KB by default when writing a message out. Start (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 3 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 | « vm/object.cc ('k') | vm/snapshot_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/snapshot.h
===================================================================
--- vm/snapshot.h (revision 12139)
+++ vm/snapshot.h (working copy)
@@ -388,7 +388,9 @@
}
protected:
- BaseWriter(uint8_t** buffer, ReAlloc alloc) : stream_(buffer, alloc) {
+ BaseWriter(uint8_t** buffer,
+ ReAlloc alloc,
+ intptr_t increment_size) : stream_(buffer, alloc, increment_size) {
ASSERT(buffer != NULL);
ASSERT(alloc != NULL);
}
@@ -414,8 +416,11 @@
class SnapshotWriter : public BaseWriter {
protected:
- SnapshotWriter(Snapshot::Kind kind, uint8_t** buffer, ReAlloc alloc)
- : BaseWriter(buffer, alloc),
+ SnapshotWriter(Snapshot::Kind kind,
+ uint8_t** buffer,
+ ReAlloc alloc,
+ intptr_t increment_size)
+ : BaseWriter(buffer, alloc, increment_size),
kind_(kind),
object_store_(Isolate::Current()->object_store()),
class_table_(Isolate::Current()->class_table()),
@@ -492,8 +497,9 @@
class FullSnapshotWriter : public SnapshotWriter {
public:
+ static const intptr_t kIncrementSize = 64 * KB;
FullSnapshotWriter(uint8_t** buffer, ReAlloc alloc)
- : SnapshotWriter(Snapshot::kFull, buffer, alloc) {
+ : SnapshotWriter(Snapshot::kFull, buffer, alloc, kIncrementSize) {
ASSERT(buffer != NULL);
ASSERT(alloc != NULL);
}
@@ -509,8 +515,9 @@
class ScriptSnapshotWriter : public SnapshotWriter {
public:
+ static const intptr_t kIncrementSize = 64 * KB;
ScriptSnapshotWriter(uint8_t** buffer, ReAlloc alloc)
- : SnapshotWriter(Snapshot::kScript, buffer, alloc) {
+ : SnapshotWriter(Snapshot::kScript, buffer, alloc, kIncrementSize) {
ASSERT(buffer != NULL);
ASSERT(alloc != NULL);
}
@@ -526,8 +533,9 @@
class MessageWriter : public SnapshotWriter {
public:
+ static const intptr_t kIncrementSize = 512;
MessageWriter(uint8_t** buffer, ReAlloc alloc)
- : SnapshotWriter(Snapshot::kMessage, buffer, alloc) {
+ : SnapshotWriter(Snapshot::kMessage, buffer, alloc, kIncrementSize) {
ASSERT(buffer != NULL);
ASSERT(alloc != NULL);
}
« no previous file with comments | « vm/object.cc ('k') | vm/snapshot_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698