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

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

Issue 2625613002: Implemented basic heap memory allocation tracking in MallocHooks using hooks registered with tcmall… (Closed)
Patch Set: 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
« no previous file with comments | « runtime/bin/gen_snapshot.cc ('k') | runtime/platform/assert.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <string.h> 6 #include <string.h>
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "include/dart_api.h" 9 #include "include/dart_api.h"
10 #include "include/dart_tools_api.h" 10 #include "include/dart_tools_api.h"
(...skipping 13 matching lines...) Expand all
24 #include "bin/thread.h" 24 #include "bin/thread.h"
25 #include "bin/utils.h" 25 #include "bin/utils.h"
26 #include "bin/vmservice_impl.h" 26 #include "bin/vmservice_impl.h"
27 #include "platform/globals.h" 27 #include "platform/globals.h"
28 #include "platform/hashmap.h" 28 #include "platform/hashmap.h"
29 #include "platform/text_buffer.h" 29 #include "platform/text_buffer.h"
30 #if !defined(DART_PRECOMPILER) 30 #if !defined(DART_PRECOMPILER)
31 #include "zlib/zlib.h" 31 #include "zlib/zlib.h"
32 #endif 32 #endif
33 33
34 #include "vm/malloc_hooks.h"
35
34 namespace dart { 36 namespace dart {
35 namespace bin { 37 namespace bin {
36 38
37 // vm_isolate_snapshot_buffer points to a snapshot for the vm isolate if we 39 // vm_isolate_snapshot_buffer points to a snapshot for the vm isolate if we
38 // link in a snapshot otherwise it is initialized to NULL. 40 // link in a snapshot otherwise it is initialized to NULL.
39 extern const uint8_t* vm_isolate_snapshot_buffer; 41 extern const uint8_t* vm_isolate_snapshot_buffer;
40 42
41 // isolate_snapshot_buffer points to a snapshot for an isolate if we link in a 43 // isolate_snapshot_buffer points to a snapshot for an isolate if we link in a
42 // snapshot otherwise it is initialized to NULL. 44 // snapshot otherwise it is initialized to NULL.
43 extern const uint8_t* isolate_snapshot_buffer; 45 extern const uint8_t* isolate_snapshot_buffer;
(...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after
1892 // Free decompressed memory as it has been copied into a Dart array. 1894 // Free decompressed memory as it has been copied into a Dart array.
1893 free(decompressed); 1895 free(decompressed);
1894 return tar_file; 1896 return tar_file;
1895 } 1897 }
1896 #else // !defined(DART_PRECOMPILER) 1898 #else // !defined(DART_PRECOMPILER)
1897 static Dart_GetVMServiceAssetsArchive GetVMServiceAssetsArchiveCallback = NULL; 1899 static Dart_GetVMServiceAssetsArchive GetVMServiceAssetsArchiveCallback = NULL;
1898 #endif // !defined(DART_PRECOMPILER) 1900 #endif // !defined(DART_PRECOMPILER)
1899 1901
1900 1902
1901 void main(int argc, char** argv) { 1903 void main(int argc, char** argv) {
1904 MallocHooks::Init();
1902 char* script_name; 1905 char* script_name;
1903 const int EXTRA_VM_ARGUMENTS = 8; 1906 const int EXTRA_VM_ARGUMENTS = 8;
1904 CommandLineOptions vm_options(argc + EXTRA_VM_ARGUMENTS); 1907 CommandLineOptions vm_options(argc + EXTRA_VM_ARGUMENTS);
1905 CommandLineOptions dart_options(argc); 1908 CommandLineOptions dart_options(argc);
1906 bool print_flags_seen = false; 1909 bool print_flags_seen = false;
1907 bool verbose_debug_seen = false; 1910 bool verbose_debug_seen = false;
1908 1911
1909 // Perform platform specific initialization. 1912 // Perform platform specific initialization.
1910 if (!Platform::Initialize()) { 1913 if (!Platform::Initialize()) {
1911 Log::PrintErr("Initialization failed\n"); 1914 Log::PrintErr("Initialization failed\n");
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
2048 Platform::Exit(Process::GlobalExitCode()); 2051 Platform::Exit(Process::GlobalExitCode());
2049 } 2052 }
2050 2053
2051 } // namespace bin 2054 } // namespace bin
2052 } // namespace dart 2055 } // namespace dart
2053 2056
2054 int main(int argc, char** argv) { 2057 int main(int argc, char** argv) {
2055 dart::bin::main(argc, argv); 2058 dart::bin::main(argc, argv);
2056 UNREACHABLE(); 2059 UNREACHABLE();
2057 } 2060 }
OLDNEW
« no previous file with comments | « runtime/bin/gen_snapshot.cc ('k') | runtime/platform/assert.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698