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

Side by Side Diff: net/disk_cache/trace.cc

Issue 12207084: Make DiskCacheTest.MultipleInstances pass in net_unittests on Windows 64-bit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: command fix for 64bit memory usage Created 7 years, 10 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 | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "net/disk_cache/trace.h" 5 #include "net/disk_cache/trace.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 #if defined(OS_WIN) 8 #if defined(OS_WIN)
9 #include <windows.h> 9 #include <windows.h>
10 #endif 10 #endif
11 11
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "net/disk_cache/stress_support.h" 13 #include "net/disk_cache/stress_support.h"
14 14
15 // Change this value to 1 to enable tracing on a release build. By default, 15 // Change this value to 1 to enable tracing on a release build. By default,
16 // tracing is enabled only on debug builds. 16 // tracing is enabled only on debug builds.
17 #define ENABLE_TRACING 0 17 #define ENABLE_TRACING 0
18 18
19 #ifndef NDEBUG 19 #ifndef NDEBUG
20 #undef ENABLE_TRACING 20 #undef ENABLE_TRACING
21 #define ENABLE_TRACING 1 21 #define ENABLE_TRACING 1
22 #endif 22 #endif
23 23
24 namespace { 24 namespace {
25 25
26 const int kEntrySize = 48; 26 const int kEntrySize = 12 * sizeof(size_t);
27 #if defined(NET_BUILD_STRESS_CACHE) 27 #if defined(NET_BUILD_STRESS_CACHE)
28 const int kNumberOfEntries = 500000; 28 const int kNumberOfEntries = 500000;
29 #else 29 #else
30 const int kNumberOfEntries = 5000; // 240 KB. 30 const int kNumberOfEntries = 5000; // 240 KB on 32bit, 480 KB on 64bit
31 #endif 31 #endif
32 32
33 bool s_trace_enabled = false; 33 bool s_trace_enabled = false;
34 34
35 struct TraceBuffer { 35 struct TraceBuffer {
36 int num_traces; 36 int num_traces;
37 int current; 37 int current;
38 char buffer[kNumberOfEntries][kEntrySize]; 38 char buffer[kNumberOfEntries][kEntrySize];
39 }; 39 };
40 40
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 void DestroyTrace(void) { 170 void DestroyTrace(void) {
171 s_trace_object = NULL; 171 s_trace_object = NULL;
172 } 172 }
173 173
174 void Trace(const char* format, ...) { 174 void Trace(const char* format, ...) {
175 } 175 }
176 176
177 #endif // ENABLE_TRACING 177 #endif // ENABLE_TRACING
178 178
179 } // namespace disk_cache 179 } // namespace disk_cache
OLDNEW
« 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