Christopher Ferris | 5daf4e4 | 2014-04-22 18:52:58 -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 | LOCAL_PATH := $(call my-dir) |
| 18 | |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 19 | jemalloc_common_cflags := \ |
Alex Naidis | f608984 | 2016-11-19 21:03:14 +0100 | [diff] [blame] | 20 | -std=gnu11 \ |
Christopher Ferris | 5daf4e4 | 2014-04-22 18:52:58 -0700 | [diff] [blame] | 21 | -D_REENTRANT \ |
Alex Naidis | 98f468a | 2016-08-19 22:57:27 +0200 | [diff] [blame] | 22 | -O3 \ |
| 23 | -funroll-loops \ |
Christopher Ferris | 5daf4e4 | 2014-04-22 18:52:58 -0700 | [diff] [blame] | 24 | -fvisibility=hidden \ |
| 25 | -Wno-unused-parameter \ |
Colin Cross | 7027478 | 2015-12-29 16:56:11 -0800 | [diff] [blame] | 26 | -Wno-type-limits \ |
Christopher Ferris | 5daf4e4 | 2014-04-22 18:52:58 -0700 | [diff] [blame] | 27 | |
Christopher Ferris | d481006 | 2014-11-14 12:09:46 -0800 | [diff] [blame] | 28 | # These parameters change the way jemalloc works. |
Christopher Ferris | d481006 | 2014-11-14 12:09:46 -0800 | [diff] [blame] | 29 | # ANDROID_MAX_ARENAS=XX |
| 30 | # The total number of arenas will be less than or equal to this number. |
| 31 | # The number of arenas will be calculated as 2 * the number of cpus |
| 32 | # but no larger than XX. |
| 33 | # ANDROID_TCACHE_NSLOTS_SMALL_MAX=XX |
| 34 | # The number of small slots held in the tcache. The higher this number |
| 35 | # is, the higher amount of PSS consumed. If this number is set too low |
| 36 | # then small allocations will take longer to complete. |
| 37 | # ANDROID_TCACHE_NSLOTS_LARGE=XX |
| 38 | # The number of large slots held in the tcache. The higher this number |
| 39 | # is, the higher amount of PSS consumed. If this number is set too low |
| 40 | # then large allocations will take longer to complete. |
| 41 | # ANDROID_LG_TCACHE_MAXCLASS_DEFAULT=XX |
| 42 | # 1 << XX is the maximum sized allocation that will be in the tcache. |
Christopher Ferris | 6f50cbc | 2015-09-09 12:17:01 -0700 | [diff] [blame] | 43 | # ANDROID_LG_CHUNK_DEFAULT=XX |
| 44 | # 1 << XX is the default chunk size used by the system. Decreasing this |
| 45 | # usually decreases the amount of PSS used, but can increase |
| 46 | # fragmentation. |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 47 | jemalloc_common_cflags += \ |
Christopher Ferris | d481006 | 2014-11-14 12:09:46 -0800 | [diff] [blame] | 48 | -DANDROID_LG_TCACHE_MAXCLASS_DEFAULT=16 \ |
| 49 | |
Christopher Ferris | 0879532 | 2016-07-19 14:05:20 -0700 | [diff] [blame] | 50 | ifeq ($(MALLOC_SVELTE),true) |
| 51 | # Use a single arena on svelte devices to keep the PSS consumption as low |
| 52 | # as possible. |
Josh Gao | c43b70f | 2016-01-06 16:18:06 -0800 | [diff] [blame] | 53 | jemalloc_common_cflags += \ |
Christopher Ferris | 0879532 | 2016-07-19 14:05:20 -0700 | [diff] [blame] | 54 | -DANDROID_MAX_ARENAS=1 \ |
| 55 | |
| 56 | else |
| 57 | # Only enable the tcache on non-svelte configurations, to save PSS. |
| 58 | jemalloc_common_cflags += \ |
| 59 | -DANDROID_MAX_ARENAS=2 \ |
| 60 | -DJEMALLOC_TCACHE \ |
| 61 | -DANDROID_TCACHE_NSLOTS_SMALL_MAX=8 \ |
| 62 | -DANDROID_TCACHE_NSLOTS_LARGE=16 \ |
| 63 | |
Josh Gao | c43b70f | 2016-01-06 16:18:06 -0800 | [diff] [blame] | 64 | endif |
| 65 | |
Christopher Ferris | 6f50cbc | 2015-09-09 12:17:01 -0700 | [diff] [blame] | 66 | # Use a 512K chunk size on 32 bit systems. |
| 67 | # This keeps the total amount of virtual address space consumed |
| 68 | # by jemalloc lower. |
| 69 | jemalloc_common_cflags_32 += \ |
| 70 | -DANDROID_LG_CHUNK_DEFAULT=19 \ |
| 71 | |
| 72 | # Use a 2MB chunk size on 64 bit systems. |
| 73 | # This is the default currently used by 4.0.0. |
| 74 | jemalloc_common_cflags_64 += \ |
| 75 | -DANDROID_LG_CHUNK_DEFAULT=21 \ |
| 76 | |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 77 | jemalloc_common_c_includes := \ |
Christopher Ferris | 5daf4e4 | 2014-04-22 18:52:58 -0700 | [diff] [blame] | 78 | $(LOCAL_PATH)/src \ |
| 79 | $(LOCAL_PATH)/include \ |
| 80 | |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 81 | jemalloc_lib_src_files := \ |
Christopher Ferris | 5daf4e4 | 2014-04-22 18:52:58 -0700 | [diff] [blame] | 82 | src/arena.c \ |
| 83 | src/atomic.c \ |
| 84 | src/base.c \ |
| 85 | src/bitmap.c \ |
| 86 | src/chunk.c \ |
| 87 | src/chunk_dss.c \ |
| 88 | src/chunk_mmap.c \ |
| 89 | src/ckh.c \ |
| 90 | src/ctl.c \ |
| 91 | src/extent.c \ |
| 92 | src/hash.c \ |
| 93 | src/huge.c \ |
| 94 | src/jemalloc.c \ |
| 95 | src/mb.c \ |
| 96 | src/mutex.c \ |
Christopher Ferris | 54d4dfa | 2016-03-02 16:24:07 -0800 | [diff] [blame] | 97 | src/nstime.c \ |
Christopher Ferris | 6f50cbc | 2015-09-09 12:17:01 -0700 | [diff] [blame] | 98 | src/pages.c \ |
Christopher Ferris | 54d4dfa | 2016-03-02 16:24:07 -0800 | [diff] [blame] | 99 | src/prng.c \ |
Christopher Ferris | 5daf4e4 | 2014-04-22 18:52:58 -0700 | [diff] [blame] | 100 | src/prof.c \ |
| 101 | src/quarantine.c \ |
| 102 | src/rtree.c \ |
| 103 | src/stats.c \ |
| 104 | src/tcache.c \ |
Christopher Ferris | 54d4dfa | 2016-03-02 16:24:07 -0800 | [diff] [blame] | 105 | src/ticker.c \ |
Christopher Ferris | 5daf4e4 | 2014-04-22 18:52:58 -0700 | [diff] [blame] | 106 | src/tsd.c \ |
| 107 | src/util.c \ |
| 108 | |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 109 | #----------------------------------------------------------------------- |
| 110 | # jemalloc static library |
| 111 | #----------------------------------------------------------------------- |
| 112 | include $(CLEAR_VARS) |
| 113 | |
| 114 | LOCAL_MODULE := libjemalloc |
| 115 | LOCAL_MODULE_TAGS := optional |
| 116 | |
| 117 | LOCAL_ADDITIONAL_DEPENDENCIES := \ |
| 118 | $(LOCAL_PATH)/Android.mk \ |
| 119 | |
| 120 | LOCAL_CFLAGS := \ |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 121 | $(jemalloc_common_cflags) \ |
| 122 | -include bionic/libc/private/libc_logging.h \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 123 | |
Christopher Ferris | 6f50cbc | 2015-09-09 12:17:01 -0700 | [diff] [blame] | 124 | LOCAL_CFLAGS_32 := $(jemalloc_common_cflags_32) |
| 125 | LOCAL_CFLAGS_64 := $(jemalloc_common_cflags_64) |
| 126 | |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 127 | LOCAL_C_INCLUDES := \ |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 128 | $(jemalloc_common_c_includes) \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 129 | |
| 130 | LOCAL_SRC_FILES := \ |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 131 | $(jemalloc_lib_src_files) \ |
Christopher Ferris | 18ff841 | 2014-05-13 15:22:02 -0700 | [diff] [blame] | 132 | |
Evgenii Stepanov | 53421a7 | 2015-06-11 15:16:33 -0700 | [diff] [blame] | 133 | # This is linked into libc, which asan runtime library depends on. |
| 134 | LOCAL_SANITIZE := never |
| 135 | |
Colin Cross | 55a166e | 2016-04-07 13:28:20 -0700 | [diff] [blame] | 136 | LOCAL_CXX_STL := none |
| 137 | |
Christopher Ferris | 5daf4e4 | 2014-04-22 18:52:58 -0700 | [diff] [blame] | 138 | include $(BUILD_STATIC_LIBRARY) |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 139 | |
| 140 | #----------------------------------------------------------------------- |
| 141 | # jemalloc static jet library |
| 142 | #----------------------------------------------------------------------- |
| 143 | include $(CLEAR_VARS) |
| 144 | |
| 145 | LOCAL_MODULE := libjemalloc_jet |
| 146 | LOCAL_MODULE_TAGS := optional |
| 147 | |
| 148 | LOCAL_ADDITIONAL_DEPENDENCIES := \ |
| 149 | $(LOCAL_PATH)/Android.mk \ |
| 150 | |
| 151 | LOCAL_CFLAGS := \ |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 152 | $(jemalloc_common_cflags) \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 153 | -DJEMALLOC_JET \ |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 154 | -include $(LOCAL_PATH)/android/include/libc_logging.h \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 155 | |
Christopher Ferris | 6f50cbc | 2015-09-09 12:17:01 -0700 | [diff] [blame] | 156 | LOCAL_CFLAGS_32 := $(jemalloc_common_cflags_32) |
| 157 | LOCAL_CFLAGS_64 := $(jemalloc_common_cflags_64) |
| 158 | |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 159 | LOCAL_C_INCLUDES := \ |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 160 | $(jemalloc_common_c_includes) \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 161 | |
| 162 | LOCAL_SRC_FILES := \ |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 163 | $(jemalloc_lib_src_files) \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 164 | |
Colin Cross | 55a166e | 2016-04-07 13:28:20 -0700 | [diff] [blame] | 165 | LOCAL_CXX_STL := none |
| 166 | |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 167 | include $(BUILD_STATIC_LIBRARY) |
| 168 | |
Christopher Ferris | 96d58c8 | 2015-04-22 06:59:40 +0000 | [diff] [blame] | 169 | jemalloc_testlib_srcs := \ |
| 170 | test/src/btalloc.c \ |
| 171 | test/src/btalloc_0.c \ |
| 172 | test/src/btalloc_1.c \ |
| 173 | test/src/math.c \ |
Christopher Ferris | 6f50cbc | 2015-09-09 12:17:01 -0700 | [diff] [blame] | 174 | test/src/mq.c \ |
Christopher Ferris | 96d58c8 | 2015-04-22 06:59:40 +0000 | [diff] [blame] | 175 | test/src/mtx.c \ |
| 176 | test/src/SFMT.c \ |
| 177 | test/src/test.c \ |
| 178 | test/src/thd.c \ |
| 179 | test/src/timer.c \ |
| 180 | |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 181 | #----------------------------------------------------------------------- |
| 182 | # jemalloc unit test library |
| 183 | #----------------------------------------------------------------------- |
| 184 | include $(CLEAR_VARS) |
| 185 | |
| 186 | LOCAL_MODULE := libjemalloc_unittest |
| 187 | LOCAL_MODULE_TAGS := optional |
| 188 | |
| 189 | LOCAL_ADDITIONAL_DEPENDENCIES := \ |
| 190 | $(LOCAL_PATH)/Android.mk \ |
| 191 | |
| 192 | LOCAL_CFLAGS := \ |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 193 | $(jemalloc_common_cflags) \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 194 | -DJEMALLOC_UNIT_TEST \ |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 195 | -include $(LOCAL_PATH)/android/include/libc_logging.h \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 196 | |
Christopher Ferris | 6f50cbc | 2015-09-09 12:17:01 -0700 | [diff] [blame] | 197 | LOCAL_CFLAGS_32 := $(jemalloc_common_cflags_32) |
| 198 | LOCAL_CFLAGS_64 := $(jemalloc_common_cflags_64) |
| 199 | |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 200 | LOCAL_C_INCLUDES := \ |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 201 | $(jemalloc_common_c_includes) \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 202 | $(LOCAL_PATH)/test/src \ |
| 203 | $(LOCAL_PATH)/test/include \ |
| 204 | |
Christopher Ferris | 96d58c8 | 2015-04-22 06:59:40 +0000 | [diff] [blame] | 205 | LOCAL_SRC_FILES := $(jemalloc_testlib_srcs) |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 206 | |
| 207 | LOCAL_WHOLE_STATIC_LIBRARIES := libjemalloc_jet |
| 208 | |
Colin Cross | 55a166e | 2016-04-07 13:28:20 -0700 | [diff] [blame] | 209 | LOCAL_CXX_STL := none |
| 210 | |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 211 | include $(BUILD_STATIC_LIBRARY) |
Christopher Ferris | 6f50cbc | 2015-09-09 12:17:01 -0700 | [diff] [blame] | 212 | #include $(BUILD_SHARED_LIBRARY) |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 213 | |
| 214 | #----------------------------------------------------------------------- |
| 215 | # jemalloc unit tests |
| 216 | #----------------------------------------------------------------------- |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 217 | jemalloc_unit_tests := \ |
Christopher Ferris | 9528f3c | 2014-12-04 19:39:53 -0800 | [diff] [blame] | 218 | test/unit/atomic.c \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 219 | test/unit/bitmap.c \ |
| 220 | test/unit/ckh.c \ |
Christopher Ferris | 54d4dfa | 2016-03-02 16:24:07 -0800 | [diff] [blame] | 221 | test/unit/decay.c \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 222 | test/unit/hash.c \ |
| 223 | test/unit/junk.c \ |
Christopher Ferris | 96d58c8 | 2015-04-22 06:59:40 +0000 | [diff] [blame] | 224 | test/unit/junk_alloc.c \ |
| 225 | test/unit/junk_free.c \ |
| 226 | test/unit/lg_chunk.c \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 227 | test/unit/mallctl.c \ |
| 228 | test/unit/math.c \ |
| 229 | test/unit/mq.c \ |
| 230 | test/unit/mtx.c \ |
Christopher Ferris | 54d4dfa | 2016-03-02 16:24:07 -0800 | [diff] [blame] | 231 | test/unit/nstime.c \ |
| 232 | test/unit/prng.c \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 233 | test/unit/prof_accum.c \ |
Christopher Ferris | 6f50cbc | 2015-09-09 12:17:01 -0700 | [diff] [blame] | 234 | test/unit/prof_active.c \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 235 | test/unit/prof_gdump.c \ |
| 236 | test/unit/prof_idump.c \ |
Christopher Ferris | 96d58c8 | 2015-04-22 06:59:40 +0000 | [diff] [blame] | 237 | test/unit/prof_reset.c \ |
| 238 | test/unit/prof_thread_name.c \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 239 | test/unit/ql.c \ |
| 240 | test/unit/qr.c \ |
| 241 | test/unit/quarantine.c \ |
| 242 | test/unit/rb.c \ |
| 243 | test/unit/rtree.c \ |
Christopher Ferris | 54d4dfa | 2016-03-02 16:24:07 -0800 | [diff] [blame] | 244 | test/unit/run_quantize.c \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 245 | test/unit/SFMT.c \ |
Christopher Ferris | 35d78ee | 2015-07-10 10:39:41 -0700 | [diff] [blame] | 246 | test/unit/size_classes.c \ |
Christopher Ferris | 54d4dfa | 2016-03-02 16:24:07 -0800 | [diff] [blame] | 247 | test/unit/smoothstep.c \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 248 | test/unit/stats.c \ |
Christopher Ferris | 54d4dfa | 2016-03-02 16:24:07 -0800 | [diff] [blame] | 249 | test/unit/ticker.c \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 250 | test/unit/tsd.c \ |
| 251 | test/unit/util.c \ |
| 252 | test/unit/zero.c \ |
| 253 | |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 254 | $(foreach test,$(jemalloc_unit_tests), \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 255 | $(eval test_name := $(basename $(notdir $(test)))); \ |
| 256 | $(eval test_src := $(test)); \ |
Colin Cross | 3dd4001 | 2015-12-18 14:12:15 -0800 | [diff] [blame] | 257 | $(eval test_cflags := -DJEMALLOC_UNIT_TEST); \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 258 | $(eval test_libs := libjemalloc_unittest); \ |
| 259 | $(eval test_path := jemalloc_unittests); \ |
| 260 | $(eval include $(LOCAL_PATH)/Android.test.mk) \ |
| 261 | ) |
| 262 | |
| 263 | #----------------------------------------------------------------------- |
| 264 | # jemalloc integration test library |
| 265 | #----------------------------------------------------------------------- |
| 266 | include $(CLEAR_VARS) |
| 267 | |
| 268 | LOCAL_MODULE := libjemalloc_integrationtest |
| 269 | LOCAL_MODULE_TAGS := optional |
| 270 | |
| 271 | LOCAL_ADDITIONAL_DEPENDENCIES := \ |
| 272 | $(LOCAL_PATH)/Android.mk \ |
| 273 | |
| 274 | LOCAL_CFLAGS := \ |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 275 | $(jemalloc_common_cflags) \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 276 | -DJEMALLOC_INTEGRATION_TEST \ |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 277 | -include $(LOCAL_PATH)/android/include/libc_logging.h \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 278 | |
Christopher Ferris | 6f50cbc | 2015-09-09 12:17:01 -0700 | [diff] [blame] | 279 | LOCAL_CFLAGS_32 := $(jemalloc_common_cflags_32) |
| 280 | LOCAL_CFLAGS_64 := $(jemalloc_common_cflags_64) |
| 281 | |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 282 | LOCAL_C_INCLUDES := \ |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 283 | $(jemalloc_common_c_includes) \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 284 | $(LOCAL_PATH)/test/src \ |
| 285 | $(LOCAL_PATH)/test/include \ |
| 286 | |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 287 | LOCAL_SRC_FILES := \ |
| 288 | $(jemalloc_testlib_srcs) \ |
| 289 | $(jemalloc_lib_src_files) \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 290 | |
Colin Cross | 55a166e | 2016-04-07 13:28:20 -0700 | [diff] [blame] | 291 | LOCAL_CXX_STL := none |
| 292 | |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 293 | include $(BUILD_STATIC_LIBRARY) |
| 294 | |
| 295 | #----------------------------------------------------------------------- |
| 296 | # jemalloc integration tests |
| 297 | #----------------------------------------------------------------------- |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 298 | jemalloc_integration_tests := \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 299 | test/integration/aligned_alloc.c \ |
| 300 | test/integration/allocated.c \ |
Christopher Ferris | 6f50cbc | 2015-09-09 12:17:01 -0700 | [diff] [blame] | 301 | test/integration/chunk.c \ |
Colin Cross | 368f61e | 2015-12-29 16:56:53 -0800 | [diff] [blame] | 302 | test/integration/iterate.c \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 303 | test/integration/MALLOCX_ARENA.c \ |
Christopher Ferris | 6f50cbc | 2015-09-09 12:17:01 -0700 | [diff] [blame] | 304 | test/integration/mallocx.c \ |
| 305 | test/integration/overflow.c \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 306 | test/integration/posix_memalign.c \ |
| 307 | test/integration/rallocx.c \ |
Christopher Ferris | 6f50cbc | 2015-09-09 12:17:01 -0700 | [diff] [blame] | 308 | test/integration/sdallocx.c \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 309 | test/integration/thread_arena.c \ |
| 310 | test/integration/thread_tcache_enabled.c \ |
| 311 | test/integration/xallocx.c \ |
| 312 | |
Christopher Ferris | fc0bd6b | 2015-06-25 17:51:54 +0000 | [diff] [blame] | 313 | $(foreach test,$(jemalloc_integration_tests), \ |
Christopher Ferris | c2ad06c | 2014-07-08 20:56:17 -0700 | [diff] [blame] | 314 | $(eval test_name := $(basename $(notdir $(test)))); \ |
| 315 | $(eval test_src := $(test)); \ |
| 316 | $(eval test_cflags := -DJEMALLOC_INTEGRATION_TEST); \ |
| 317 | $(eval test_libs := libjemalloc_integrationtest); \ |
| 318 | $(eval test_path := jemalloc_integrationtests); \ |
| 319 | $(eval include $(LOCAL_PATH)/Android.test.mk) \ |
| 320 | ) |