OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 #include <stddef.h> |
5 #include <stdio.h> | 6 #include <stdio.h> |
6 #include <map> | 7 #include <map> |
7 | 8 |
8 #include "base/logging.h" | 9 #include "base/logging.h" |
9 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
10 | 11 |
11 bool inH = true; | 12 bool inH = true; |
12 struct H { | 13 struct H { |
13 H() { inH = false; tick_ = 0; bw_ = 0; d_bw_ = d_tick_ = 0; m_bw_ = 0; mem_ =
high_ = 0;} | 14 H() { inH = false; tick_ = 0; bw_ = 0; d_bw_ = d_tick_ = 0; m_bw_ = 0; mem_ =
high_ = 0;} |
14 ~H() { | 15 ~H() { |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 //printf("%u\n", s); | 118 //printf("%u\n", s); |
118 void *p = malloc(s); | 119 void *p = malloc(s); |
119 _H.add(s, p); | 120 _H.add(s, p); |
120 return p; | 121 return p; |
121 } | 122 } |
122 | 123 |
123 void operator delete(void *p) { | 124 void operator delete(void *p) { |
124 _H.sub(p); | 125 _H.sub(p); |
125 free(p); | 126 free(p); |
126 } | 127 } |
OLD | NEW |