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

Side by Side Diff: base/allocator/allocator.gyp

Issue 434067: Branch the files in the shim layer that switches between the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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 | « base/allocator/README ('k') | base/allocator/allocator_shim.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) 2009 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2009 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 { 5 {
6 'variables': {
7 'jemalloc_dir': '../../third_party/jemalloc/chromium',
8 'tcmalloc_dir': '../../third_party/tcmalloc/chromium',
9 },
6 'targets': [ 10 'targets': [
7 { 11 {
8 'target_name': 'tcmalloc', 12 'target_name': 'allocator',
9 'type': '<(library)', 13 'type': '<(library)',
10 'msvs_guid': 'C564F145-9172-42C3-BFCB-60FDEA124321', 14 'msvs_guid': 'C564F145-9172-42C3-BFCB-60FDEA124321',
11 'include_dirs': [ 15 'include_dirs': [
12 '.', 16 '.',
13 'tcmalloc/src/base', 17 '<(tcmalloc_dir)/src/base',
14 'tcmalloc/src', 18 '<(tcmalloc_dir)/src',
15 '../..', 19 '../..',
16 ], 20 ],
17 'defines': [ 21 'defines': [
18 'NO_TCMALLOC_SAMPLES', 22 'NO_TCMALLOC_SAMPLES',
19 ], 23 ],
20 'direct_dependent_settings': { 24 'direct_dependent_settings': {
21 'configurations': { 25 'configurations': {
22 'Common': { 26 'Common': {
23 'msvs_settings': { 27 'msvs_settings': {
24 'VCLinkerTool': { 28 'VCLinkerTool': {
25 'IgnoreDefaultLibraryNames': ['libcmtd.lib', 'libcmt.lib'], 29 'IgnoreDefaultLibraryNames': ['libcmtd.lib', 'libcmt.lib'],
26 'AdditionalDependencies': [ 30 'AdditionalDependencies': [
27 '<(SHARED_INTERMEDIATE_DIR)/tcmalloc/libcmt.lib' 31 '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib'
28 ], 32 ],
29 }, 33 },
30 }, 34 },
31 }, 35 },
32 }, 36 },
33 'conditions': [ 37 'conditions': [
34 ['OS=="win"', { 38 ['OS=="win"', {
35 'defines': [ 39 'defines': [
36 ['PERFTOOLS_DLL_DECL', ''] 40 ['PERFTOOLS_DLL_DECL', '']
37 ], 41 ],
38 }], 42 }],
39 ], 43 ],
40 }, 44 },
41 'sources': [ 45 'sources': [
42 'config.h', 46 # Generated for our configuration from tcmalloc's build
43 'config_linux.h', 47 # and checked in.
44 'config_win.h', 48 '<(tcmalloc_dir)/src/config.h',
49 '<(tcmalloc_dir)/src/config_linux.h',
50 '<(tcmalloc_dir)/src/config_win.h',
45 51
46 # tcmalloc files 52 # tcmalloc files
47 'tcmalloc/src/base/dynamic_annotations.cc', 53 '<(tcmalloc_dir)/src/base/dynamic_annotations.cc',
48 'tcmalloc/src/base/dynamic_annotations.h', 54 '<(tcmalloc_dir)/src/base/dynamic_annotations.h',
49 'tcmalloc/src/base/logging.cc', 55 '<(tcmalloc_dir)/src/base/logging.cc',
50 'tcmalloc/src/base/logging.h', 56 '<(tcmalloc_dir)/src/base/logging.h',
51 'tcmalloc/src/base/low_level_alloc.cc', 57 '<(tcmalloc_dir)/src/base/low_level_alloc.cc',
52 'tcmalloc/src/base/low_level_alloc.h', 58 '<(tcmalloc_dir)/src/base/low_level_alloc.h',
53 'tcmalloc/src/base/spinlock.cc', 59 '<(tcmalloc_dir)/src/base/spinlock.cc',
54 'tcmalloc/src/base/spinlock.h', 60 '<(tcmalloc_dir)/src/base/spinlock.h',
55 'tcmalloc/src/base/sysinfo.cc', 61 '<(tcmalloc_dir)/src/base/sysinfo.cc',
56 'tcmalloc/src/base/sysinfo.h', 62 '<(tcmalloc_dir)/src/base/sysinfo.h',
57 'tcmalloc/src/central_freelist.cc', 63 '<(tcmalloc_dir)/src/central_freelist.cc',
58 'tcmalloc/src/central_freelist.h', 64 '<(tcmalloc_dir)/src/central_freelist.h',
59 'tcmalloc/src/common.cc', 65 '<(tcmalloc_dir)/src/common.cc',
60 'tcmalloc/src/common.h', 66 '<(tcmalloc_dir)/src/common.h',
61 'tcmalloc/src/heap-profile-table.cc', 67 '<(tcmalloc_dir)/src/heap-profile-table.cc',
62 'tcmalloc/src/heap-profile-table.h', 68 '<(tcmalloc_dir)/src/heap-profile-table.h',
63 'tcmalloc/src/internal_logging.cc', 69 '<(tcmalloc_dir)/src/internal_logging.cc',
64 'tcmalloc/src/internal_logging.h', 70 '<(tcmalloc_dir)/src/internal_logging.h',
65 'tcmalloc/src/linked_list.h', 71 '<(tcmalloc_dir)/src/linked_list.h',
66 'tcmalloc/src/malloc_hook.cc', 72 '<(tcmalloc_dir)/src/malloc_hook.cc',
67 'tcmalloc/src/malloc_hook-inl.h', 73 '<(tcmalloc_dir)/src/malloc_hook-inl.h',
68 'tcmalloc/src/malloc_extension.cc', 74 '<(tcmalloc_dir)/src/malloc_extension.cc',
69 'tcmalloc/src/google/malloc_extension.h', 75 '<(tcmalloc_dir)/src/google/malloc_extension.h',
70 'tcmalloc/src/page_heap.cc', 76 '<(tcmalloc_dir)/src/page_heap.cc',
71 'tcmalloc/src/page_heap.h', 77 '<(tcmalloc_dir)/src/page_heap.h',
72 'tcmalloc/src/port.h', 78 '<(tcmalloc_dir)/src/sampler.cc',
73 'tcmalloc/src/sampler.cc', 79 '<(tcmalloc_dir)/src/sampler.h',
74 'tcmalloc/src/sampler.h', 80 '<(tcmalloc_dir)/src/span.cc',
75 'tcmalloc/src/span.cc', 81 '<(tcmalloc_dir)/src/span.h',
76 'tcmalloc/src/span.h', 82 '<(tcmalloc_dir)/src/stack_trace_table.cc',
77 'tcmalloc/src/stack_trace_table.cc', 83 '<(tcmalloc_dir)/src/stack_trace_table.h',
78 'tcmalloc/src/stack_trace_table.h', 84 '<(tcmalloc_dir)/src/stacktrace.cc',
79 'tcmalloc/src/stacktrace.cc', 85 '<(tcmalloc_dir)/src/stacktrace.h',
80 'tcmalloc/src/stacktrace.h', 86 '<(tcmalloc_dir)/src/static_vars.cc',
81 'tcmalloc/src/static_vars.cc', 87 '<(tcmalloc_dir)/src/static_vars.h',
82 'tcmalloc/src/static_vars.h', 88 '<(tcmalloc_dir)/src/thread_cache.cc',
83 'tcmalloc/src/thread_cache.cc', 89 '<(tcmalloc_dir)/src/thread_cache.h',
84 'tcmalloc/src/thread_cache.h', 90 '<(tcmalloc_dir)/src/windows/port.cc',
91 '<(tcmalloc_dir)/src/windows/port.h',
85 92
86 # non-windows 93 # non-windows
87 'tcmalloc/src/base/linuxthreads.cc', 94 '<(tcmalloc_dir)/src/base/linuxthreads.cc',
88 'tcmalloc/src/base/linuxthreads.h', 95 '<(tcmalloc_dir)/src/base/linuxthreads.h',
89 'tcmalloc/src/base/vdso_support.cc', 96 '<(tcmalloc_dir)/src/base/vdso_support.cc',
90 'tcmalloc/src/base/vdso_support.h', 97 '<(tcmalloc_dir)/src/base/vdso_support.h',
91 'tcmalloc/src/google/tcmalloc.h', 98 '<(tcmalloc_dir)/src/google/tcmalloc.h',
92 'tcmalloc/src/maybe_threads.cc', 99 '<(tcmalloc_dir)/src/maybe_threads.cc',
93 'tcmalloc/src/maybe_threads.h', 100 '<(tcmalloc_dir)/src/maybe_threads.h',
94 'tcmalloc/src/symbolize.cc', 101 '<(tcmalloc_dir)/src/symbolize.cc',
95 'tcmalloc/src/symbolize.h', 102 '<(tcmalloc_dir)/src/symbolize.h',
96 'tcmalloc/src/system-alloc.cc', 103 '<(tcmalloc_dir)/src/system-alloc.cc',
97 'tcmalloc/src/system-alloc.h', 104 '<(tcmalloc_dir)/src/system-alloc.h',
98 'tcmalloc/src/tcmalloc.cc', 105 '<(tcmalloc_dir)/src/tcmalloc.cc',
99 106
100 # heap-profiler/checker/cpuprofiler 107 # heap-profiler/checker/cpuprofiler
101 'tcmalloc/src/base/thread_lister.c', 108 '<(tcmalloc_dir)/src/base/thread_lister.c',
102 'tcmalloc/src/base/thread_lister.h', 109 '<(tcmalloc_dir)/src/base/thread_lister.h',
103 'tcmalloc/src/heap-checker-bcad.cc', 110 '<(tcmalloc_dir)/src/heap-checker-bcad.cc',
104 'tcmalloc/src/heap-checker.cc', 111 '<(tcmalloc_dir)/src/heap-checker.cc',
105 'tcmalloc/src/heap-profiler.cc', 112 '<(tcmalloc_dir)/src/heap-profiler.cc',
106 'tcmalloc/src/memory_region_map.cc', 113 '<(tcmalloc_dir)/src/memory_region_map.cc',
107 'tcmalloc/src/memory_region_map.h', 114 '<(tcmalloc_dir)/src/memory_region_map.h',
108 'tcmalloc/src/profiledata.cc', 115 '<(tcmalloc_dir)/src/profiledata.cc',
109 'tcmalloc/src/profiledata.h', 116 '<(tcmalloc_dir)/src/profiledata.h',
110 'tcmalloc/src/profile-handler.cc', 117 '<(tcmalloc_dir)/src/profile-handler.cc',
111 'tcmalloc/src/profile-handler.h', 118 '<(tcmalloc_dir)/src/profile-handler.h',
112 'tcmalloc/src/profiler.cc', 119 '<(tcmalloc_dir)/src/profiler.cc',
113 'tcmalloc/src/raw_printer.cc', 120 '<(tcmalloc_dir)/src/raw_printer.cc',
114 'tcmalloc/src/raw_printer.h', 121 '<(tcmalloc_dir)/src/raw_printer.h',
115 122
116 # tcmalloc forked files 123 # jemalloc files
124 '<(jemalloc_dir)/jemalloc.c',
125 '<(jemalloc_dir)/jemalloc.h',
126 '<(jemalloc_dir)/ql.h',
127 '<(jemalloc_dir)/qr.h',
128 '<(jemalloc_dir)/rb.h',
129
117 'allocator_shim.cc', 130 'allocator_shim.cc',
118 'generic_allocators.cc', 131 'generic_allocators.cc',
119 'page_heap.cc',
120 'page_heap.h',
121 'port.cc',
122 'system-alloc.h',
123 'tcmalloc.cc',
124 'win_allocator.cc', 132 'win_allocator.cc',
125
126 # jemalloc files
127 'jemalloc/jemalloc.c',
128 'jemalloc/jemalloc.h',
129 'jemalloc/ql.h',
130 'jemalloc/qr.h',
131 'jemalloc/rb.h',
132 ], 133 ],
133 # sources! means that these are not compiled directly. 134 # sources! means that these are not compiled directly.
134 'sources!': [ 135 'sources!': [
135 'generic_allocators.cc', 136 'generic_allocators.cc',
136 'tcmalloc.cc',
137 'win_allocator.cc', 137 'win_allocator.cc',
138
139 '<(tcmalloc_dir)/src/tcmalloc.cc',
138 ], 140 ],
139 'msvs_settings': { 141 'msvs_settings': {
140 # TODO(sgk): merge this with build/common.gypi settings 142 # TODO(sgk): merge this with build/common.gypi settings
141 'VCLibrarianTool=': { 143 'VCLibrarianTool=': {
142 'AdditionalOptions': '/ignore:4006,4221', 144 'AdditionalOptions': '/ignore:4006,4221',
143 'AdditionalLibraryDirectories': 145 'AdditionalLibraryDirectories':
144 ['<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Lib'], 146 ['<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Lib'],
145 }, 147 },
146 'VCLinkerTool': { 148 'VCLinkerTool': {
147 'AdditionalOptions': '/ignore:4006', 149 'AdditionalOptions': '/ignore:4006',
(...skipping 10 matching lines...) Expand all
158 }, 160 },
159 'conditions': [ 161 'conditions': [
160 ['OS=="win"', { 162 ['OS=="win"', {
161 'defines': [ 163 'defines': [
162 ['PERFTOOLS_DLL_DECL', ''] 164 ['PERFTOOLS_DLL_DECL', '']
163 ], 165 ],
164 'dependencies': [ 166 'dependencies': [
165 'libcmt', 167 'libcmt',
166 ], 168 ],
167 'include_dirs': [ 169 'include_dirs': [
168 'tcmalloc/src/windows', 170 '<(tcmalloc_dir)/src/windows',
169 ], 171 ],
170 'sources!': [ 172 'sources!': [
171 'tcmalloc/src/base/linuxthreads.cc', 173 '<(tcmalloc_dir)/src/base/linuxthreads.cc',
172 'tcmalloc/src/base/linuxthreads.h', 174 '<(tcmalloc_dir)/src/base/linuxthreads.h',
173 'tcmalloc/src/base/vdso_support.cc', 175 '<(tcmalloc_dir)/src/base/vdso_support.cc',
174 'tcmalloc/src/base/vdso_support.h', 176 '<(tcmalloc_dir)/src/base/vdso_support.h',
175 'tcmalloc/src/maybe_threads.cc', 177 '<(tcmalloc_dir)/src/maybe_threads.cc',
176 'tcmalloc/src/maybe_threads.h', 178 '<(tcmalloc_dir)/src/maybe_threads.h',
177 'tcmalloc/src/symbolize.cc', 179 '<(tcmalloc_dir)/src/symbolize.cc',
178 'tcmalloc/src/symbolize.h', 180 '<(tcmalloc_dir)/src/symbolize.h',
179 'tcmalloc/src/system-alloc.cc', 181 '<(tcmalloc_dir)/src/system-alloc.cc',
180 'tcmalloc/src/system-alloc.h', 182 '<(tcmalloc_dir)/src/system-alloc.h',
181
182 # use forked version in windows
183 'tcmalloc/src/tcmalloc.cc',
184 'tcmalloc/src/page_heap.cc',
185 'tcmalloc/src/page_heap.h',
186 183
187 # heap-profiler/checker/cpuprofiler 184 # heap-profiler/checker/cpuprofiler
188 'tcmalloc/src/base/thread_lister.c', 185 '<(tcmalloc_dir)/src/base/thread_lister.c',
189 'tcmalloc/src/base/thread_lister.h', 186 '<(tcmalloc_dir)/src/base/thread_lister.h',
190 'tcmalloc/src/heap-checker-bcad.cc', 187 '<(tcmalloc_dir)/src/heap-checker-bcad.cc',
191 'tcmalloc/src/heap-checker.cc', 188 '<(tcmalloc_dir)/src/heap-checker.cc',
192 'tcmalloc/src/heap-profiler.cc', 189 '<(tcmalloc_dir)/src/heap-profiler.cc',
193 'tcmalloc/src/memory_region_map.cc', 190 '<(tcmalloc_dir)/src/memory_region_map.cc',
194 'tcmalloc/src/memory_region_map.h', 191 '<(tcmalloc_dir)/src/memory_region_map.h',
195 'tcmalloc/src/profiledata.cc', 192 '<(tcmalloc_dir)/src/profiledata.cc',
196 'tcmalloc/src/profiledata.h', 193 '<(tcmalloc_dir)/src/profiledata.h',
197 'tcmalloc/src/profile-handler.cc', 194 '<(tcmalloc_dir)/src/profile-handler.cc',
198 'tcmalloc/src/profile-handler.h', 195 '<(tcmalloc_dir)/src/profile-handler.h',
199 'tcmalloc/src/profiler.cc', 196 '<(tcmalloc_dir)/src/profiler.cc',
200 ], 197 ],
201 }], 198 }],
202 ['OS=="linux"', { 199 ['OS=="linux"', {
203 'sources!': [ 200 'sources!': [
204 'page_heap.cc', 201 '<(tcmalloc_dir)/src/page_heap.cc',
205 'port.cc', 202 '<(tcmalloc_dir)/src/system-alloc.h',
206 'system-alloc.h', 203 '<(tcmalloc_dir)/src/windows/port.cc',
207 'win_allocator.cc', 204 '<(tcmalloc_dir)/src/windows/port.h',
208 205
209 # TODO(willchan): Support allocator shim later on. 206 # TODO(willchan): Support allocator shim later on.
210 'allocator_shim.cc', 207 'allocator_shim.cc',
211 208
212 # TODO(willchan): support jemalloc on other platforms 209 # TODO(willchan): support jemalloc on other platforms
213 # jemalloc files 210 # jemalloc files
214 'jemalloc/jemalloc.c', 211 '<(jemalloc_dir)/jemalloc.c',
215 'jemalloc/jemalloc.h', 212 '<(jemalloc_dir)/jemalloc.h',
216 'jemalloc/ql.h', 213 '<(jemalloc_dir)/ql.h',
217 'jemalloc/qr.h', 214 '<(jemalloc_dir)/qr.h',
218 'jemalloc/rb.h', 215 '<(jemalloc_dir)/rb.h',
219 ], 216 ],
220 'cflags!': [ 217 'cflags!': [
221 '-fvisibility=hidden', 218 '-fvisibility=hidden',
222 ], 219 ],
223 'link_settings': { 220 'link_settings': {
224 'ldflags': [ 221 'ldflags': [
225 # Don't let linker rip this symbol out, otherwise the heap&cpu 222 # Don't let linker rip this symbol out, otherwise the heap&cpu
226 # profilers will not initialize properly on startup. 223 # profilers will not initialize properly on startup.
227 '-Wl,-uIsHeapProfilerRunning,-uProfilerStart', 224 '-Wl,-uIsHeapProfilerRunning,-uProfilerStart',
228 # Do the same for heap leak checker. 225 # Do the same for heap leak checker.
229 '-Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapP KvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi', 226 '-Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapP KvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi',
230 '-Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapP KvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl', 227 '-Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapP KvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl',
231 ], 228 ],
232 }, 229 },
233 }], 230 }],
234 ], 231 ],
235 }, 232 },
236 { 233 {
237 'target_name': 'tcmalloc_unittests', 234 'target_name': 'allocator_unittests',
238 'type': 'executable', 235 'type': 'executable',
239 'dependencies': [ 236 'dependencies': [
240 'tcmalloc', 237 'allocator',
241 '../../testing/gtest.gyp:gtest', 238 '../../testing/gtest.gyp:gtest',
242 ], 239 ],
243 'include_dirs': [ 240 'include_dirs': [
244 '.', 241 '.',
245 'tcmalloc/src/base', 242 '<(tcmalloc_dir)/src/base',
246 'tcmalloc/src', 243 '<(tcmalloc_dir)/src',
247 '../..', 244 '../..',
248 ], 245 ],
249 'msvs_guid': 'E99DA267-BE90-4F45-1294-6919DB2C9999', 246 'msvs_guid': 'E99DA267-BE90-4F45-1294-6919DB2C9999',
250 'sources': [ 247 'sources': [
251 'unittest_utils.cc', 248 'unittest_utils.cc',
252 'tcmalloc_unittests.cc', 249 'allocator_unittests.cc',
253 ], 250 ],
254 }, 251 },
255 ], 252 ],
256 'conditions': [ 253 'conditions': [
257 ['OS=="win"', { 254 ['OS=="win"', {
258 'targets': [ 255 'targets': [
259 { 256 {
260 'target_name': 'libcmt', 257 'target_name': 'libcmt',
261 'type': 'none', 258 'type': 'none',
262 'actions': [ 259 'actions': [
263 { 260 {
264 'action_name': 'libcmt', 261 'action_name': 'libcmt',
265 'inputs': [ 262 'inputs': [
266 'prep_libc.sh', 263 'prep_libc.sh',
267 ], 264 ],
268 'outputs': [ 265 'outputs': [
269 '<(SHARED_INTERMEDIATE_DIR)/tcmalloc/libcmt.lib', 266 '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib',
270 ], 267 ],
271 'action': [ 268 'action': [
272 './prep_libc.sh', 269 './prep_libc.sh',
273 '$(VCInstallDir)lib', 270 '$(VCInstallDir)lib',
274 '<(SHARED_INTERMEDIATE_DIR)/tcmalloc', 271 '<(SHARED_INTERMEDIATE_DIR)/allocator',
275 ], 272 ],
276 }, 273 },
277 ], 274 ],
278 }, 275 },
279 ], 276 ],
280 }], 277 }],
281 ], 278 ],
282 } 279 }
283 280
284 # Local Variables: 281 # Local Variables:
285 # tab-width:2 282 # tab-width:2
286 # indent-tabs-mode:nil 283 # indent-tabs-mode:nil
287 # End: 284 # End:
288 # vim: set expandtab tabstop=2 shiftwidth=2: 285 # vim: set expandtab tabstop=2 shiftwidth=2:
OLDNEW
« no previous file with comments | « base/allocator/README ('k') | base/allocator/allocator_shim.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698