aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-11 05:04:09 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-11 05:04:09 +0000
commit0880241bed0cab2350738dc5c3dcc2e2db135afb (patch)
tree197ea5de65685c58a5c50beb6770c7dd850ff332
parent4a4ae20c4808b9786c851c34211df79c596b8c0d (diff)
parent00b0763d656a7ec4d9a4e2475167f4ea8e28e641 (diff)
downloadjemalloc_new-android13-mainline-mediaprovider-release.tar.gz
Change-Id: Id7c72902f6496ca947fe90de4d31bf62bd9c317f
-rw-r--r--Android.bp14
-rw-r--r--include/jemalloc/internal/jemalloc_internal_defs_host.h2
-rw-r--r--src/jemalloc.c2
3 files changed, 14 insertions, 4 deletions
diff --git a/Android.bp b/Android.bp
index 80eede97..1f5855a1 100644
--- a/Android.bp
+++ b/Android.bp
@@ -122,7 +122,6 @@ android_product_variables = {
cc_defaults {
name: "jemalloc5_defaults",
- defaults: ["linux_bionic_supported"],
host_supported: true,
native_bridge_supported: true,
cflags: common_cflags,
@@ -132,7 +131,7 @@ cc_defaults {
cflags: android_common_cflags,
product_variables: android_product_variables,
},
- linux_glibc: {
+ linux_bionic: {
enabled: true,
},
},
@@ -201,6 +200,11 @@ cc_library {
system_shared_libs: [],
header_libs: ["libc_headers"],
},
+ musl: {
+ // Linking against musl uses libjemalloc5 by default, list only
+ // libc_musl here to avoid a circular dependency.
+ system_shared_libs: ["libc_musl"],
+ },
},
}
@@ -333,8 +337,10 @@ cc_test {
test_per_src: true,
target: {
- linux_glibc: {
+ linux_bionic: {
enabled: true,
+ },
+ linux_glibc: {
// The sanitizer does not work for these tests on the host.
sanitize: {
never: true,
@@ -354,6 +360,7 @@ cc_library_static {
cflags: [
"-U_FORTIFY_SOURCE",
"-DJEMALLOC_INTEGRATION_TEST",
+ "-DJEMALLOC_NO_RENAME",
],
local_include_dirs: [
@@ -390,6 +397,7 @@ cc_test {
cflags: common_cflags + [
"-DJEMALLOC_INTEGRATION_TEST",
+ "-DJEMALLOC_NO_RENAME",
],
local_include_dirs: common_c_local_includes + [
diff --git a/include/jemalloc/internal/jemalloc_internal_defs_host.h b/include/jemalloc/internal/jemalloc_internal_defs_host.h
index 38f91bc2..f4c973bf 100644
--- a/include/jemalloc/internal/jemalloc_internal_defs_host.h
+++ b/include/jemalloc/internal/jemalloc_internal_defs_host.h
@@ -376,6 +376,8 @@
/*
* Defined if strerror_r returns char * if _GNU_SOURCE is defined.
*/
+#ifdef __GLIBC__
#define JEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE
+#endif
#endif /* JEMALLOC_INTERNAL_DEFS_H_ */
diff --git a/src/jemalloc.c b/src/jemalloc.c
index 0584362f..bf5976b3 100644
--- a/src/jemalloc.c
+++ b/src/jemalloc.c
@@ -111,7 +111,7 @@ static uint8_t malloc_slow_flags;
#ifdef JEMALLOC_THREADED_INIT
/* Used to let the initializing thread recursively allocate. */
-# define NO_INITIALIZER ((unsigned long)0)
+# define NO_INITIALIZER ((pthread_t)0)
# define INITIALIZER pthread_self()
# define IS_INITIALIZER (malloc_initializer == pthread_self())
static pthread_t malloc_initializer = NO_INITIALIZER;