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

Side by Side Diff: base/allocator/allocator_shim.cc

Issue 9200009: windows: Fix a few things clang complains about. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/file_util_win.cc » ('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) 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 "base/allocator/allocator_shim.h" 5 #include "base/allocator/allocator_shim.h"
6 6
7 #include <config.h> 7 #include <config.h>
8 #include "base/sysinfo.h" 8 #include "base/sysinfo.h"
9 9
10 // When defined, different heap allocators can be used via an environment 10 // When defined, different heap allocators can be used via an environment
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 size_t primary_length = 0; 287 size_t primary_length = 0;
288 getenv_s(&primary_length, NULL, 0, primary_name); 288 getenv_s(&primary_length, NULL, 0, primary_name);
289 289
290 size_t secondary_length = 0; 290 size_t secondary_length = 0;
291 char buffer[20]; 291 char buffer[20];
292 getenv_s(&secondary_length, buffer, sizeof(buffer), secondary_name); 292 getenv_s(&secondary_length, buffer, sizeof(buffer), secondary_name);
293 DCHECK_GT(sizeof(buffer), secondary_length); 293 DCHECK_GT(sizeof(buffer), secondary_length);
294 buffer[sizeof(buffer) - 1] = '\0'; 294 buffer[sizeof(buffer) - 1] = '\0';
295 295
296 if (secondary_length || !primary_length) { 296 if (secondary_length || !primary_length) {
297 char* secondary_value = secondary_length ? buffer : "TCMALLOC"; 297 const char* secondary_value = secondary_length ? buffer : "TCMALLOC";
298 // Force renderer (or other subprocesses) to use secondary_value. 298 // Force renderer (or other subprocesses) to use secondary_value.
299 int ret_val = _putenv_s(primary_name, secondary_value); 299 int ret_val = _putenv_s(primary_name, secondary_value);
300 DCHECK_EQ(0, ret_val); 300 DCHECK_EQ(0, ret_val);
301 } 301 }
302 #endif // ENABLE_DYNAMIC_ALLOCATOR_SWITCHING 302 #endif // ENABLE_DYNAMIC_ALLOCATOR_SWITCHING
303 } 303 }
304 304
305 } // namespace base. 305 } // namespace base.
306 } // namespace allocator. 306 } // namespace allocator.
OLDNEW
« no previous file with comments | « no previous file | base/file_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698