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

Unified Diff: runtime/bin/gen_snapshot.cc

Issue 25648005: Speed up gen_snapshot by writing all bytes at once. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/gen_snapshot.cc
diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc
index 0612f1588805abf1c6d2f03c912645d98d9253c1..9f707433bdc931d37e6bae0500c5cb61f2bbb118 100644
--- a/runtime/bin/gen_snapshot.cc
+++ b/runtime/bin/gen_snapshot.cc
@@ -143,8 +143,8 @@ static int ParseArguments(int argc,
static void WriteSnapshotFile(const uint8_t* buffer, const intptr_t size) {
File* file = File::Open(snapshot_filename, File::kWriteTruncate);
ASSERT(file != NULL);
- for (intptr_t i = 0; i < size; i++) {
- file->WriteByte(buffer[i]);
+ if (!file->WriteFully(buffer, size)) {
+ Log::PrintErr("Error: Failed to write full snapshot.\n\n");
}
delete file;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698