aboutsummaryrefslogtreecommitdiffstats
path: root/libc/bionic/dlmalloc.c
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-07-17 14:26:33 -0700
committerElliott Hughes <enh@google.com>2014-07-17 14:26:33 -0700
commitd7453860a6b06e7d4a960c20792ce6f0b6cc5f3a (patch)
treeeb16bdf461a93257bf1f16a7e7eabb36f52a4e46 /libc/bionic/dlmalloc.c
parent43363ab7202a935e12cf6a38d32a48433bdc3705 (diff)
downloadandroid_bionic-d7453860a6b06e7d4a960c20792ce6f0b6cc5f3a.tar.gz
android_bionic-d7453860a6b06e7d4a960c20792ce6f0b6cc5f3a.tar.bz2
android_bionic-d7453860a6b06e7d4a960c20792ce6f0b6cc5f3a.zip
Remove non-standard prctl constants from <sys/prctl.h>.
Also remove __bionic_name_mem which has exactly one caller, and is only ever expected to be used in this one place. Change-Id: I833744f91e887639f5b2d1269f966ee9032af207
Diffstat (limited to 'libc/bionic/dlmalloc.c')
-rw-r--r--libc/bionic/dlmalloc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libc/bionic/dlmalloc.c b/libc/bionic/dlmalloc.c
index 2d67392c0..7ecca1d3e 100644
--- a/libc/bionic/dlmalloc.c
+++ b/libc/bionic/dlmalloc.c
@@ -26,11 +26,16 @@ static void __bionic_heap_usage_error(const char* function, void* address);
#define CORRUPTION_ERROR_ACTION(m) __bionic_heap_corruption_error(__FUNCTION__)
#define USAGE_ERROR_ACTION(m,p) __bionic_heap_usage_error(__FUNCTION__, p)
-/* Bionic named anonymous memory declarations */
+// Bionic named anonymous memory declarations.
static void* named_anonymous_mmap(size_t length);
#define MMAP(s) named_anonymous_mmap(s)
#define DIRECT_MMAP(s) named_anonymous_mmap(s)
+// Local definitions of custom prctl arguments to set a vma name in Android kernels.
+#include <sys/prctl.h>
+#define PR_SET_VMA 0x53564d41
+#define PR_SET_VMA_ANON_NAME 0
+
// Ugly inclusion of C file so that bionic specific #defines configure dlmalloc.
#include "../upstream-dlmalloc/malloc.c"
@@ -51,6 +56,6 @@ static void* named_anonymous_mmap(size_t length) {
if (map == MAP_FAILED) {
return map;
}
- __bionic_name_mem(map, length, "libc_malloc");
+ prctl(BIONIC_PR_SET_VMA, BIONIC_PR_SET_VMA_ANON_NAME, map, length, "libc_malloc");
return map;
}