OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/allocator/allocator_extension_thunks.h" | 8 #include "base/allocator/allocator_extension_thunks.h" |
9 #include "base/profiler/alternate_timer.h" | 9 #include "base/profiler/alternate_timer.h" |
10 #include "base/sysinfo.h" | 10 #include "base/sysinfo.h" |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 | 321 |
322 if (secondary_length || !primary_length) { | 322 if (secondary_length || !primary_length) { |
323 const char* secondary_value = secondary_length ? buffer : "TCMALLOC"; | 323 const char* secondary_value = secondary_length ? buffer : "TCMALLOC"; |
324 // Force renderer (or other subprocesses) to use secondary_value. | 324 // Force renderer (or other subprocesses) to use secondary_value. |
325 int ret_val = _putenv_s(primary_name, secondary_value); | 325 int ret_val = _putenv_s(primary_name, secondary_value); |
326 DCHECK_EQ(0, ret_val); | 326 DCHECK_EQ(0, ret_val); |
327 } | 327 } |
328 #endif // ENABLE_DYNAMIC_ALLOCATOR_SWITCHING | 328 #endif // ENABLE_DYNAMIC_ALLOCATOR_SWITCHING |
329 } | 329 } |
330 | 330 |
| 331 void* TCMallocDoMallocForTest(size_t size) { |
| 332 return do_malloc(size); |
| 333 } |
| 334 |
| 335 void TCMallocDoFreeForTest(void* ptr) { |
| 336 do_free(ptr); |
| 337 } |
| 338 |
| 339 size_t ExcludeSpaceForMarkForTest(size_t size) { |
| 340 return ExcludeSpaceForMark(size); |
| 341 } |
| 342 |
331 } // namespace allocator. | 343 } // namespace allocator. |
332 } // namespace base. | 344 } // namespace base. |
OLD | NEW |