Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2014 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
| 16 | |
| 17 | common_cflags = [ |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 18 | "-D_REENTRANT", |
Alex Naidis | 5a22dd0 | 2016-08-19 22:57:27 +0200 | [diff] [blame] | 19 | "-O3", |
| 20 | "-funroll-loops", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 21 | "-fvisibility=hidden", |
Chih-Hung Hsieh | 033b6fd | 2017-09-28 12:17:52 -0700 | [diff] [blame] | 22 | "-Werror", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 23 | "-Wno-unused-parameter", |
Colin Cross | 7027478 | 2015-12-29 16:56:11 -0800 | [diff] [blame] | 24 | "-Wno-type-limits", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 25 | ] |
| 26 | |
| 27 | // These parameters change the way jemalloc works. |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 28 | // ANDROID_MAX_ARENAS=XX |
| 29 | // The total number of arenas will be less than or equal to this number. |
| 30 | // The number of arenas will be calculated as 2 * the number of cpus |
| 31 | // but no larger than XX. |
| 32 | // ANDROID_TCACHE_NSLOTS_SMALL_MAX=XX |
| 33 | // The number of small slots held in the tcache. The higher this number |
| 34 | // is, the higher amount of PSS consumed. If this number is set too low |
| 35 | // then small allocations will take longer to complete. |
| 36 | // ANDROID_TCACHE_NSLOTS_LARGE=XX |
| 37 | // The number of large slots held in the tcache. The higher this number |
| 38 | // is, the higher amount of PSS consumed. If this number is set too low |
| 39 | // then large allocations will take longer to complete. |
| 40 | // ANDROID_LG_TCACHE_MAXCLASS_DEFAULT=XX |
| 41 | // 1 << XX is the maximum sized allocation that will be in the tcache. |
| 42 | // ANDROID_LG_CHUNK_DEFAULT=XX |
| 43 | // 1 << XX is the default chunk size used by the system. Decreasing this |
| 44 | // usually decreases the amount of PSS used, but can increase |
| 45 | // fragmentation. |
Christopher Ferris | 53bf335 | 2016-07-19 14:05:20 -0700 | [diff] [blame] | 46 | |
Christopher Ferris | bb9b1cf | 2018-09-13 20:24:10 +0000 | [diff] [blame] | 47 | android_common_cflags = [ |
| 48 | // Default to a single arena for svelte configurations to minimize |
| 49 | // PSS. This will be overridden by android_product_variables for |
| 50 | // non-svelte configs. |
Christopher Ferris | 53bf335 | 2016-07-19 14:05:20 -0700 | [diff] [blame] | 51 | "-DANDROID_MAX_ARENAS=1", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 52 | "-DANDROID_LG_TCACHE_MAXCLASS_DEFAULT=16", |
| 53 | ] |
| 54 | |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 55 | common_c_local_includes = [ |
| 56 | "src", |
| 57 | "include", |
| 58 | ] |
| 59 | |
Christopher Ferris | bb9b1cf | 2018-09-13 20:24:10 +0000 | [diff] [blame] | 60 | android_product_variables = { |
Dan Willemsen | e67f1d5 | 2016-03-01 17:23:40 -0800 | [diff] [blame] | 61 | // Only enable the tcache on non-svelte configurations, to save PSS. |
| 62 | malloc_not_svelte: { |
Christopher Ferris | 53bf335 | 2016-07-19 14:05:20 -0700 | [diff] [blame] | 63 | cflags: [ |
| 64 | "-UANDROID_MAX_ARENAS", |
| 65 | "-DANDROID_MAX_ARENAS=2", |
| 66 | "-DJEMALLOC_TCACHE", |
| 67 | "-DANDROID_TCACHE_NSLOTS_SMALL_MAX=8", |
| 68 | "-DANDROID_TCACHE_NSLOTS_LARGE=16", |
| 69 | ], |
Dan Willemsen | e67f1d5 | 2016-03-01 17:23:40 -0800 | [diff] [blame] | 70 | }, |
| 71 | } |
| 72 | |
| 73 | cc_defaults { |
| 74 | name: "jemalloc_defaults", |
Dan Willemsen | ba738bb | 2016-11-04 12:25:48 -0700 | [diff] [blame] | 75 | defaults: ["linux_bionic_supported"], |
Christopher Ferris | bb9b1cf | 2018-09-13 20:24:10 +0000 | [diff] [blame] | 76 | host_supported: true, |
Dan Willemsen | e67f1d5 | 2016-03-01 17:23:40 -0800 | [diff] [blame] | 77 | cflags: common_cflags, |
| 78 | |
Christopher Ferris | bb9b1cf | 2018-09-13 20:24:10 +0000 | [diff] [blame] | 79 | target: { |
| 80 | android: { |
| 81 | cflags: android_common_cflags + [ |
| 82 | "-include android/include/log.h", |
| 83 | ], |
| 84 | product_variables: android_product_variables, |
| 85 | }, |
Dan Willemsen | 9447c6b | 2018-10-12 00:37:49 -0700 | [diff] [blame] | 86 | linux_bionic: { |
| 87 | cflags: ["-DJEMALLOC_TCACHE"], |
| 88 | }, |
Christopher Ferris | bb9b1cf | 2018-09-13 20:24:10 +0000 | [diff] [blame] | 89 | linux_glibc: { |
| 90 | enabled: true, |
| 91 | }, |
| 92 | }, |
Dan Willemsen | e67f1d5 | 2016-03-01 17:23:40 -0800 | [diff] [blame] | 93 | |
| 94 | multilib: { |
| 95 | lib32: { |
| 96 | // Use a 512K chunk size on 32 bit systems. |
| 97 | // This keeps the total amount of virtual address space consumed |
| 98 | // by jemalloc lower. |
| 99 | cflags: [ |
| 100 | "-DANDROID_LG_CHUNK_DEFAULT=19", |
| 101 | ], |
| 102 | }, |
| 103 | lib64: { |
| 104 | // Use a 2MB chunk size on 64 bit systems. |
| 105 | // This is the default currently used by 4.0.0 |
| 106 | cflags: [ |
| 107 | "-DANDROID_LG_CHUNK_DEFAULT=21", |
| 108 | ], |
| 109 | }, |
| 110 | }, |
| 111 | |
| 112 | local_include_dirs: common_c_local_includes, |
Colin Cross | 4daa75d | 2016-04-07 13:28:20 -0700 | [diff] [blame] | 113 | stl: "none", |
Dan Willemsen | e67f1d5 | 2016-03-01 17:23:40 -0800 | [diff] [blame] | 114 | } |
| 115 | |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 116 | lib_src_files = [ |
| 117 | "src/arena.c", |
| 118 | "src/atomic.c", |
| 119 | "src/base.c", |
| 120 | "src/bitmap.c", |
| 121 | "src/chunk.c", |
| 122 | "src/chunk_dss.c", |
| 123 | "src/chunk_mmap.c", |
| 124 | "src/ckh.c", |
| 125 | "src/ctl.c", |
| 126 | "src/extent.c", |
| 127 | "src/hash.c", |
| 128 | "src/huge.c", |
| 129 | "src/jemalloc.c", |
| 130 | "src/mb.c", |
| 131 | "src/mutex.c", |
Dan Willemsen | ec006d8 | 2016-03-07 16:22:25 -0800 | [diff] [blame] | 132 | "src/nstime.c", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 133 | "src/pages.c", |
Dan Willemsen | ec006d8 | 2016-03-07 16:22:25 -0800 | [diff] [blame] | 134 | "src/prng.c", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 135 | "src/prof.c", |
| 136 | "src/quarantine.c", |
| 137 | "src/rtree.c", |
Christopher Ferris | fb1f094 | 2016-11-08 14:47:48 -0800 | [diff] [blame] | 138 | "src/spin.c", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 139 | "src/stats.c", |
| 140 | "src/tcache.c", |
Dan Willemsen | ec006d8 | 2016-03-07 16:22:25 -0800 | [diff] [blame] | 141 | "src/ticker.c", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 142 | "src/tsd.c", |
| 143 | "src/util.c", |
Christopher Ferris | 3545247 | 2016-06-14 14:28:47 -0700 | [diff] [blame] | 144 | "src/witness.c", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 145 | ] |
| 146 | |
| 147 | //----------------------------------------------------------------------- |
| 148 | // jemalloc static library |
| 149 | //----------------------------------------------------------------------- |
Christopher Ferris | bb9b1cf | 2018-09-13 20:24:10 +0000 | [diff] [blame] | 150 | cc_library { |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 151 | name: "libjemalloc", |
Jiyong Park | 20a932e | 2018-04-27 21:47:48 +0900 | [diff] [blame] | 152 | recovery_available: true, |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 153 | |
Dan Willemsen | e67f1d5 | 2016-03-01 17:23:40 -0800 | [diff] [blame] | 154 | defaults: ["jemalloc_defaults"], |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 155 | |
Christopher Ferris | bb9b1cf | 2018-09-13 20:24:10 +0000 | [diff] [blame] | 156 | target: { |
| 157 | android: { |
| 158 | shared: { |
| 159 | enabled: false, |
| 160 | }, |
| 161 | }, |
| 162 | }, |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 163 | |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 164 | srcs: lib_src_files, |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 165 | } |
| 166 | |
| 167 | //----------------------------------------------------------------------- |
| 168 | // jemalloc static jet library |
| 169 | //----------------------------------------------------------------------- |
| 170 | cc_library_static { |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 171 | name: "libjemalloc_jet", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 172 | |
Dan Willemsen | e67f1d5 | 2016-03-01 17:23:40 -0800 | [diff] [blame] | 173 | defaults: ["jemalloc_defaults"], |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 174 | |
Dan Willemsen | 2ee91d8 | 2016-05-25 15:06:55 -0700 | [diff] [blame] | 175 | cflags: [ |
| 176 | "-DJEMALLOC_JET", |
Dan Willemsen | 2ee91d8 | 2016-05-25 15:06:55 -0700 | [diff] [blame] | 177 | ], |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 178 | |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 179 | srcs: lib_src_files, |
| 180 | |
| 181 | } |
| 182 | |
| 183 | jemalloc_testlib_srcs = [ |
| 184 | "test/src/btalloc.c", |
| 185 | "test/src/btalloc_0.c", |
| 186 | "test/src/btalloc_1.c", |
| 187 | "test/src/math.c", |
| 188 | "test/src/mq.c", |
| 189 | "test/src/mtx.c", |
| 190 | "test/src/SFMT.c", |
| 191 | "test/src/test.c", |
| 192 | "test/src/thd.c", |
| 193 | "test/src/timer.c", |
| 194 | ] |
| 195 | |
| 196 | //----------------------------------------------------------------------- |
| 197 | // jemalloc unit test library |
| 198 | //----------------------------------------------------------------------- |
| 199 | cc_library_static { |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 200 | name: "libjemalloc_unittest", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 201 | |
Dan Willemsen | e67f1d5 | 2016-03-01 17:23:40 -0800 | [diff] [blame] | 202 | defaults: ["jemalloc_defaults"], |
Dan Willemsen | 2ee91d8 | 2016-05-25 15:06:55 -0700 | [diff] [blame] | 203 | cflags: [ |
| 204 | "-DJEMALLOC_UNIT_TEST", |
Dan Willemsen | 2ee91d8 | 2016-05-25 15:06:55 -0700 | [diff] [blame] | 205 | ], |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 206 | |
Dan Willemsen | e67f1d5 | 2016-03-01 17:23:40 -0800 | [diff] [blame] | 207 | local_include_dirs: [ |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 208 | "test/src", |
| 209 | "test/include", |
| 210 | ], |
| 211 | |
| 212 | srcs: jemalloc_testlib_srcs, |
| 213 | |
| 214 | whole_static_libs: ["libjemalloc_jet"], |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 215 | } |
| 216 | |
| 217 | //----------------------------------------------------------------------- |
| 218 | // jemalloc unit tests |
| 219 | //----------------------------------------------------------------------- |
| 220 | unit_tests = [ |
Christopher Ferris | 3545247 | 2016-06-14 14:28:47 -0700 | [diff] [blame] | 221 | "test/unit/a0.c", |
| 222 | "test/unit/arena_reset.c", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 223 | "test/unit/atomic.c", |
| 224 | "test/unit/bitmap.c", |
| 225 | "test/unit/ckh.c", |
Dan Willemsen | ec006d8 | 2016-03-07 16:22:25 -0800 | [diff] [blame] | 226 | "test/unit/decay.c", |
Christopher Ferris | 3545247 | 2016-06-14 14:28:47 -0700 | [diff] [blame] | 227 | "test/unit/fork.c", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 228 | "test/unit/hash.c", |
| 229 | "test/unit/junk.c", |
| 230 | "test/unit/junk_alloc.c", |
| 231 | "test/unit/junk_free.c", |
| 232 | "test/unit/lg_chunk.c", |
| 233 | "test/unit/mallctl.c", |
| 234 | "test/unit/math.c", |
| 235 | "test/unit/mq.c", |
| 236 | "test/unit/mtx.c", |
Dan Willemsen | ec006d8 | 2016-03-07 16:22:25 -0800 | [diff] [blame] | 237 | "test/unit/nstime.c", |
Christopher Ferris | bf9b018 | 2016-12-08 11:56:18 -0800 | [diff] [blame] | 238 | "test/unit/pack.c", |
| 239 | "test/unit/pages.c", |
Dan Willemsen | ec006d8 | 2016-03-07 16:22:25 -0800 | [diff] [blame] | 240 | "test/unit/prng.c", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 241 | "test/unit/prof_accum.c", |
| 242 | "test/unit/prof_active.c", |
| 243 | "test/unit/prof_gdump.c", |
| 244 | "test/unit/prof_idump.c", |
| 245 | "test/unit/prof_reset.c", |
| 246 | "test/unit/prof_thread_name.c", |
| 247 | "test/unit/ql.c", |
| 248 | "test/unit/qr.c", |
| 249 | "test/unit/quarantine.c", |
| 250 | "test/unit/rb.c", |
| 251 | "test/unit/rtree.c", |
Dan Willemsen | ec006d8 | 2016-03-07 16:22:25 -0800 | [diff] [blame] | 252 | "test/unit/run_quantize.c", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 253 | "test/unit/SFMT.c", |
| 254 | "test/unit/size_classes.c", |
Dan Willemsen | ec006d8 | 2016-03-07 16:22:25 -0800 | [diff] [blame] | 255 | "test/unit/smoothstep.c", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 256 | "test/unit/stats.c", |
Dan Willemsen | ec006d8 | 2016-03-07 16:22:25 -0800 | [diff] [blame] | 257 | "test/unit/ticker.c", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 258 | "test/unit/tsd.c", |
| 259 | "test/unit/util.c", |
Christopher Ferris | 3545247 | 2016-06-14 14:28:47 -0700 | [diff] [blame] | 260 | "test/unit/witness.c", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 261 | "test/unit/zero.c", |
| 262 | ] |
| 263 | |
Dan Willemsen | f0f4585 | 2015-12-21 15:29:32 -0800 | [diff] [blame] | 264 | cc_test { |
Colin Cross | 89d0f3c | 2015-09-17 15:34:16 -0700 | [diff] [blame] | 265 | name: "jemalloc_unittests", |
Dan Willemsen | f0f4585 | 2015-12-21 15:29:32 -0800 | [diff] [blame] | 266 | |
Christopher Ferris | bb9b1cf | 2018-09-13 20:24:10 +0000 | [diff] [blame] | 267 | defaults: ["jemalloc_defaults"], |
Dan Willemsen | e67f1d5 | 2016-03-01 17:23:40 -0800 | [diff] [blame] | 268 | |
Christopher Ferris | bb9b1cf | 2018-09-13 20:24:10 +0000 | [diff] [blame] | 269 | gtest: false, |
Christopher Ferris | f4496b2 | 2018-09-13 18:08:30 +0000 | [diff] [blame] | 270 | |
Dan Willemsen | 2ee91d8 | 2016-05-25 15:06:55 -0700 | [diff] [blame] | 271 | cflags: common_cflags + [ |
| 272 | "-DJEMALLOC_UNIT_TEST", |
Dan Willemsen | 2ee91d8 | 2016-05-25 15:06:55 -0700 | [diff] [blame] | 273 | ], |
Colin Cross | 89d0f3c | 2015-09-17 15:34:16 -0700 | [diff] [blame] | 274 | |
| 275 | local_include_dirs: common_c_local_includes + [ |
| 276 | "test/src", |
| 277 | "test/include", |
| 278 | ], |
| 279 | |
| 280 | srcs: unit_tests, |
| 281 | |
| 282 | static_libs: ["libjemalloc_unittest"], |
| 283 | |
Dan Willemsen | e67f1d5 | 2016-03-01 17:23:40 -0800 | [diff] [blame] | 284 | shared_libs: ["liblog"], |
Colin Cross | 89d0f3c | 2015-09-17 15:34:16 -0700 | [diff] [blame] | 285 | |
| 286 | test_per_src: true, |
Christopher Ferris | bb9b1cf | 2018-09-13 20:24:10 +0000 | [diff] [blame] | 287 | |
| 288 | target: { |
| 289 | linux_glibc: { |
| 290 | // The sanitizer does not work for these tests on the host. |
| 291 | sanitize: { |
| 292 | never: true, |
| 293 | }, |
| 294 | }, |
| 295 | }, |
Colin Cross | 89d0f3c | 2015-09-17 15:34:16 -0700 | [diff] [blame] | 296 | } |
| 297 | |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 298 | //----------------------------------------------------------------------- |
| 299 | // jemalloc integration test library |
| 300 | //----------------------------------------------------------------------- |
| 301 | cc_library_static { |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 302 | name: "libjemalloc_integrationtest", |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 303 | |
Dan Willemsen | e67f1d5 | 2016-03-01 17:23:40 -0800 | [diff] [blame] | 304 | defaults: ["jemalloc_defaults"], |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 305 | |
Dan Willemsen | 2ee91d8 | 2016-05-25 15:06:55 -0700 | [diff] [blame] | 306 | cflags: [ |
| 307 | "-DJEMALLOC_INTEGRATION_TEST", |
Dan Willemsen | 2ee91d8 | 2016-05-25 15:06:55 -0700 | [diff] [blame] | 308 | ], |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 309 | |
Dan Willemsen | e67f1d5 | 2016-03-01 17:23:40 -0800 | [diff] [blame] | 310 | local_include_dirs: [ |
Dan Willemsen | 1bd7889 | 2015-09-11 13:08:19 -0700 | [diff] [blame] | 311 | "test/src", |
| 312 | "test/include", |
| 313 | ], |
| 314 | |
| 315 | srcs: jemalloc_testlib_srcs + lib_src_files, |
| 316 | |
| 317 | } |
| 318 | |
| 319 | //----------------------------------------------------------------------- |
| 320 | // jemalloc integration tests |
| 321 | //----------------------------------------------------------------------- |
| 322 | integration_tests = [ |
| 323 | "test/integration/aligned_alloc.c", |
| 324 | "test/integration/allocated.c", |
| 325 | "test/integration/chunk.c", |
| 326 | "test/integration/MALLOCX_ARENA.c", |
| 327 | "test/integration/mallocx.c", |
| 328 | "test/integration/overflow.c", |
| 329 | "test/integration/posix_memalign.c", |
| 330 | "test/integration/rallocx.c", |
| 331 | "test/integration/sdallocx.c", |
| 332 | "test/integration/thread_arena.c", |
| 333 | "test/integration/thread_tcache_enabled.c", |
| 334 | "test/integration/xallocx.c", |
| 335 | ] |
Colin Cross | 89d0f3c | 2015-09-17 15:34:16 -0700 | [diff] [blame] | 336 | |
Christopher Ferris | bb9b1cf | 2018-09-13 20:24:10 +0000 | [diff] [blame] | 337 | android_integration_tests = [ |
| 338 | "test/integration/iterate.c", |
| 339 | ] |
Dan Willemsen | f0f4585 | 2015-12-21 15:29:32 -0800 | [diff] [blame] | 340 | |
Christopher Ferris | bb9b1cf | 2018-09-13 20:24:10 +0000 | [diff] [blame] | 341 | cc_test { |
Christopher Ferris | f4496b2 | 2018-09-13 18:08:30 +0000 | [diff] [blame] | 342 | name: "jemalloc_integrationtests", |
Christopher Ferris | fa93016 | 2018-09-07 15:15:16 -0700 | [diff] [blame] | 343 | |
Christopher Ferris | bb9b1cf | 2018-09-13 20:24:10 +0000 | [diff] [blame] | 344 | defaults: ["jemalloc_defaults"], |
| 345 | |
Dan Willemsen | f0f4585 | 2015-12-21 15:29:32 -0800 | [diff] [blame] | 346 | gtest: false, |
Colin Cross | 89d0f3c | 2015-09-17 15:34:16 -0700 | [diff] [blame] | 347 | |
Dan Willemsen | 2ee91d8 | 2016-05-25 15:06:55 -0700 | [diff] [blame] | 348 | cflags: common_cflags + [ |
| 349 | "-DJEMALLOC_INTEGRATION_TEST", |
Dan Willemsen | 2ee91d8 | 2016-05-25 15:06:55 -0700 | [diff] [blame] | 350 | ], |
Colin Cross | 89d0f3c | 2015-09-17 15:34:16 -0700 | [diff] [blame] | 351 | |
| 352 | local_include_dirs: common_c_local_includes + [ |
| 353 | "test/src", |
| 354 | "test/include", |
| 355 | ], |
| 356 | |
| 357 | srcs: integration_tests, |
Christopher Ferris | bb9b1cf | 2018-09-13 20:24:10 +0000 | [diff] [blame] | 358 | target: { |
| 359 | android: { |
| 360 | srcs: android_integration_tests, |
| 361 | }, |
| 362 | linux_glibc: { |
| 363 | // The sanitizer does not work for these tests on the host. |
| 364 | sanitize: { |
| 365 | never: true, |
| 366 | }, |
| 367 | }, |
| 368 | }, |
Colin Cross | 89d0f3c | 2015-09-17 15:34:16 -0700 | [diff] [blame] | 369 | |
| 370 | static_libs: ["libjemalloc_integrationtest"], |
| 371 | |
Dan Willemsen | e67f1d5 | 2016-03-01 17:23:40 -0800 | [diff] [blame] | 372 | shared_libs: ["liblog"], |
Colin Cross | 89d0f3c | 2015-09-17 15:34:16 -0700 | [diff] [blame] | 373 | |
| 374 | test_per_src: true, |
| 375 | } |