OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 explicit IndirectSorter(int* a) : a_(a) { } | 101 explicit IndirectSorter(int* a) : a_(a) { } |
102 | 102 |
103 bool operator() (int i0, int i1) { | 103 bool operator() (int i0, int i1) { |
104 return a_[i0] > a_[i1]; | 104 return a_[i0] > a_[i1]; |
105 } | 105 } |
106 | 106 |
107 private: | 107 private: |
108 int* a_; | 108 int* a_; |
109 }; | 109 }; |
110 | 110 |
| 111 |
111 void DumpHeapStats(const char *minidump_file) { | 112 void DumpHeapStats(const char *minidump_file) { |
112 Minidump minidump(minidump_file); | 113 Minidump minidump(minidump_file); |
113 CHECK(minidump.Read()); | 114 CHECK(minidump.Read()); |
114 | 115 |
115 MinidumpException *exception = minidump.GetException(); | 116 MinidumpException *exception = minidump.GetException(); |
116 CHECK(exception); | 117 CHECK(exception); |
117 | 118 |
118 MinidumpContext* crash_context = exception->GetContext(); | 119 MinidumpContext* crash_context = exception->GetContext(); |
119 CHECK(crash_context); | 120 CHECK(crash_context); |
120 | 121 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 int main(int argc, char **argv) { | 280 int main(int argc, char **argv) { |
280 if (argc != 2) { | 281 if (argc != 2) { |
281 fprintf(stderr, "usage: %s <minidump>\n", argv[0]); | 282 fprintf(stderr, "usage: %s <minidump>\n", argv[0]); |
282 return 1; | 283 return 1; |
283 } | 284 } |
284 | 285 |
285 DumpHeapStats(argv[1]); | 286 DumpHeapStats(argv[1]); |
286 | 287 |
287 return 0; | 288 return 0; |
288 } | 289 } |
OLD | NEW |