summaryrefslogtreecommitdiffstats
path: root/chromium/base/allocator/allocator_shim.h
blob: ca70ab0e10fa64949b53c78b7f32d71a1fba1a81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_ALLOCATOR_ALLOCATOR_SHIM_H_
#define BASE_ALLOCATOR_ALLOCATOR_SHIM_H_

#include <stddef.h>

namespace base {
namespace allocator {

// Resets the environment variable CHROME_ALLOCATOR to specify the choice to
// be used by subprocesses.  Priority is given to the current value of
// CHROME_ALLOCATOR_2 (if specified), then CHROME_ALLOCATOR (if specified), and
// then a default value (typically set to TCMALLOC).
void SetupSubprocessAllocator();

// Expose some of tcmalloc functions for test.
void* TCMallocDoMallocForTest(size_t size);
void TCMallocDoFreeForTest(void* ptr);
size_t ExcludeSpaceForMarkForTest(size_t size);

}  // namespace allocator.
}  // namespace base.

#endif   // BASE_ALLOCATOR_ALLOCATOR_SHIM_H_