summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 24a73a33..6a295326 100644
--- a/Android.bp
+++ b/Android.bp
@@ -123,7 +123,6 @@ android_product_variables = {
cc_defaults {
name: "jemalloc5_defaults",
- defaults: ["linux_bionic_supported"],
host_supported: true,
native_bridge_supported: true,
cflags: common_cflags,
@@ -133,7 +132,7 @@ cc_defaults {
cflags: android_common_cflags,
product_variables: android_product_variables,
},
- linux_glibc: {
+ linux_bionic: {
enabled: true,
},
},
@@ -205,6 +204,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"],
+ },
},
}
@@ -345,8 +349,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,
@@ -366,6 +372,7 @@ cc_library_static {
cflags: [
"-U_FORTIFY_SOURCE",
"-DJEMALLOC_INTEGRATION_TEST",
+ "-DJEMALLOC_NO_RENAME",
],
local_include_dirs: [
@@ -405,6 +412,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 7cdb6521..0e85fdfe 100644
--- a/include/jemalloc/internal/jemalloc_internal_defs_host.h
+++ b/include/jemalloc/internal/jemalloc_internal_defs_host.h
@@ -370,6 +370,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 4c94568d..8ffafb97 100644
--- a/src/jemalloc.c
+++ b/src/jemalloc.c
@@ -117,7 +117,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;