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

Side by Side Diff: runtime/bin/gen_snapshot.cc

Issue 2623613003: Implemented basic heap memory allocation tracking in MallocHooks using hooks registered with tcmall… (Closed)
Patch Set: Implemented basic heap memory allocation tracking in MallocHooks using hooks registered with tcmall… Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Generate a snapshot file after loading all the scripts specified on the 5 // Generate a snapshot file after loading all the scripts specified on the
6 // command line. 6 // command line.
7 7
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 376
377 377
378 static void WriteSnapshotFile(const char* filename, 378 static void WriteSnapshotFile(const char* filename,
379 const uint8_t* buffer, 379 const uint8_t* buffer,
380 const intptr_t size) { 380 const intptr_t size) {
381 File* file = File::Open(filename, File::kWriteTruncate); 381 File* file = File::Open(filename, File::kWriteTruncate);
382 if (file == NULL) { 382 if (file == NULL) {
383 Log::PrintErr("Error: Unable to write snapshot file: %s\n\n", filename); 383 Log::PrintErr("Error: Unable to write snapshot file: %s\n\n", filename);
384 Dart_ExitScope(); 384 Dart_ExitScope();
385 Dart_ShutdownIsolate(); 385 Dart_ShutdownIsolate();
386 Dart_Cleanup();
386 exit(kErrorExitCode); 387 exit(kErrorExitCode);
387 } 388 }
388 if (!file->WriteFully(buffer, size)) { 389 if (!file->WriteFully(buffer, size)) {
389 Log::PrintErr("Error: Failed to write snapshot file.\n\n"); 390 Log::PrintErr("Error: Failed to write snapshot file.\n\n");
390 } 391 }
391 file->Release(); 392 file->Release();
392 } 393 }
393 394
394 395
395 class UriResolverIsolateScope { 396 class UriResolverIsolateScope {
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 EventHandler::Stop(); 1372 EventHandler::Stop();
1372 return 0; 1373 return 0;
1373 } 1374 }
1374 1375
1375 } // namespace bin 1376 } // namespace bin
1376 } // namespace dart 1377 } // namespace dart
1377 1378
1378 int main(int argc, char** argv) { 1379 int main(int argc, char** argv) {
1379 return dart::bin::main(argc, argv); 1380 return dart::bin::main(argc, argv);
1380 } 1381 }
OLDNEW
« no previous file with comments | « runtime/bin/BUILD.gn ('k') | runtime/vm/dart.cc » ('j') | runtime/vm/malloc_hooks_unsupported.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698