• Home
  • History
  • Annotate
  • only in /external/chromium_org/base/allocator/
NameDateSize

..05-Nov-201420 KiB

allocator.gyp05-Nov-201423.8 KiB

allocator_extension.cc05-Nov-20141.9 KiB

allocator_extension.h05-Nov-20142.1 KiB

allocator_extension_thunks.cc05-Nov-20141.7 KiB

allocator_extension_thunks.h05-Nov-20141.2 KiB

allocator_extension_thunks.target.darwin-arm.mk05-Nov-20147.3 KiB

allocator_extension_thunks.target.darwin-arm64.mk05-Nov-20146.6 KiB

allocator_extension_thunks.target.darwin-mips.mk05-Nov-20146.9 KiB

allocator_extension_thunks.target.darwin-x86.mk05-Nov-20146.9 KiB

allocator_extension_thunks.target.darwin-x86_64.mk05-Nov-20146.9 KiB

allocator_extension_thunks.target.linux-arm.mk05-Nov-20147.3 KiB

allocator_extension_thunks.target.linux-arm64.mk05-Nov-20146.6 KiB

allocator_extension_thunks.target.linux-mips.mk05-Nov-20146.9 KiB

allocator_extension_thunks.target.linux-x86.mk05-Nov-20146.9 KiB

allocator_extension_thunks.target.linux-x86_64.mk05-Nov-20146.9 KiB

allocator_shim.cc05-Nov-201411.2 KiB

allocator_shim.h05-Nov-2014903

allocator_unittest.cc05-Nov-201415.8 KiB

BUILD.gn05-Nov-20148.4 KiB

debugallocation_shim.cc05-Nov-2014346

generic_allocators.cc05-Nov-20143.8 KiB

prep_libc.py05-Nov-20142.5 KiB

README05-Nov-20142.1 KiB

tcmalloc_unittest.cc05-Nov-20143 KiB

type_profiler.cc05-Nov-20141.7 KiB

type_profiler.h05-Nov-20141.2 KiB

type_profiler_control.cc05-Nov-2014774

type_profiler_control.h05-Nov-2014842

type_profiler_map_unittest.cc05-Nov-20142.8 KiB

type_profiler_tcmalloc.cc05-Nov-20141 KiB

type_profiler_tcmalloc.h05-Nov-2014853

type_profiler_unittest.cc05-Nov-20145.2 KiB

unittest_utils.cc05-Nov-2014518

win_allocator.cc05-Nov-20142.1 KiB

README

1Notes about the Chrome memory allocator.
2
3Background
4----------
5We use this library as a generic way to fork into any of several allocators.
6Currently we can, at runtime, switch between:
7   the default windows allocator
8   the windows low-fragmentation-heap
9   tcmalloc
10   jemalloc (the heap used most notably within Mozilla Firefox)
11
12The mechanism for hooking LIBCMT in windows is rather tricky.  The core
13problem is that by default, the windows library does not declare malloc and
14free as weak symbols.  Because of this, they cannot be overriden.  To work
15around this, we start with the LIBCMT.LIB, and manually remove all allocator
16related functions from it using the visual studio library tool.  Once removed,
17we can now link against the library and provide custom versions of the 
18allocator related functionality.
19
20
21Source code
22-----------
23This directory contains just the allocator (i.e. shim) layer that switches
24between the different underlying memory allocation implementations.
25
26The tcmalloc and jemalloc libraries originate outside of Chromium
27and exist in ../../third_party/tcmalloc and ../../third_party/jemalloc
28(currently, the actual locations are defined in the allocator.gyp file).
29The third party sources use a vendor-branch SCM pattern to track
30Chromium-specific changes independently from upstream changes.
31
32The general intent is to push local changes upstream so that over
33time we no longer need any forked files.
34
35
36Adding a new allocator
37----------------------
38Adding a new allocator requires definition of the following five functions:
39
40  extern "C" {
41    bool init();
42    void* malloc(size_t s);
43    void* realloc(void* p, size_t s);
44    void free(void* s);
45    size_t msize(void* p);
46  }
47
48All other allocation related functions (new/delete/calloc/etc) have been
49implemented generically to work across all allocators.
50
51
52Usage
53-----
54You can use the different allocators by setting the environment variable
55CHROME_ALLOCATOR to:
56   "tcmalloc"  - TC Malloc (default)
57   "jemalloc"  - JE Malloc
58   "winheap"   - Windows default heap
59   "winlfh"    - Windows Low-Fragmentation heap
60