| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 // The names of the environment variables that can optionally control the | 50 // The names of the environment variables that can optionally control the |
| 51 // selection of the allocator. The primary may be used to control overall | 51 // selection of the allocator. The primary may be used to control overall |
| 52 // allocator selection, and the secondary can be used to specify an allocator | 52 // allocator selection, and the secondary can be used to specify an allocator |
| 53 // to use in sub-processes. | 53 // to use in sub-processes. |
| 54 static const char primary_name[] = "CHROME_ALLOCATOR"; | 54 static const char primary_name[] = "CHROME_ALLOCATOR"; |
| 55 static const char secondary_name[] = "CHROME_ALLOCATOR_2"; | 55 static const char secondary_name[] = "CHROME_ALLOCATOR_2"; |
| 56 | 56 |
| 57 // We include tcmalloc and the win_allocator to get as much inlining as | 57 // We include tcmalloc and the win_allocator to get as much inlining as |
| 58 // possible. | 58 // possible. |
| 59 #include "tcmalloc.cc" | 59 #include "debugallocation_shim.cc" |
| 60 #include "win_allocator.cc" | 60 #include "win_allocator.cc" |
| 61 | 61 |
| 62 // Forward declarations from jemalloc. | 62 // Forward declarations from jemalloc. |
| 63 extern "C" { | 63 extern "C" { |
| 64 void* je_malloc(size_t s); | 64 void* je_malloc(size_t s); |
| 65 void* je_realloc(void* p, size_t s); | 65 void* je_realloc(void* p, size_t s); |
| 66 void je_free(void* s); | 66 void je_free(void* s); |
| 67 size_t je_msize(void* p); | 67 size_t je_msize(void* p); |
| 68 bool je_malloc_init_hard(); | 68 bool je_malloc_init_hard(); |
| 69 void* je_memalign(size_t a, size_t s); | 69 void* je_memalign(size_t a, size_t s); |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 void TCMallocDoFreeForTest(void* ptr) { | 436 void TCMallocDoFreeForTest(void* ptr) { |
| 437 do_free(ptr); | 437 do_free(ptr); |
| 438 } | 438 } |
| 439 | 439 |
| 440 size_t ExcludeSpaceForMarkForTest(size_t size) { | 440 size_t ExcludeSpaceForMarkForTest(size_t size) { |
| 441 return ExcludeSpaceForMark(size); | 441 return ExcludeSpaceForMark(size); |
| 442 } | 442 } |
| 443 | 443 |
| 444 } // namespace allocator. | 444 } // namespace allocator. |
| 445 } // namespace base. | 445 } // namespace base. |
| OLD | NEW |