aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-04-02 17:41:14 -0700
committerElliott Hughes <enh@google.com>2013-04-02 17:41:14 -0700
commit4ace92c62ada583b220836d76de2cfcb78d4d48d (patch)
treea1d013c340c85963ff30e029207923d5811b6d6a
parent7a29f404e11d3346e79154b8e8d72a3215febced (diff)
downloadandroid_bionic-4ace92c62ada583b220836d76de2cfcb78d4d48d.tar.gz
android_bionic-4ace92c62ada583b220836d76de2cfcb78d4d48d.tar.bz2
android_bionic-4ace92c62ada583b220836d76de2cfcb78d4d48d.zip
Stop using unreasonable numbers of map entries.
Bug: 8460659 Change-Id: Ib0ee71e3cf61e122d0449c9d8a4e4670a7d7129a
-rw-r--r--libc/bionic/dlmalloc.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/libc/bionic/dlmalloc.c b/libc/bionic/dlmalloc.c
index 87f772b80..cf09aacf0 100644
--- a/libc/bionic/dlmalloc.c
+++ b/libc/bionic/dlmalloc.c
@@ -33,10 +33,6 @@ 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)
-// We use ashmem to name the anonymous private regions created by dlmalloc.
-static void* __bionic_named_anonymous_mmap(size_t length);
-#define MMAP(s) __bionic_named_anonymous_mmap(s)
-
// Ugly inclusion of C file so that bionic specific #defines configure dlmalloc.
#include "../upstream-dlmalloc/malloc.c"
@@ -53,31 +49,3 @@ static void __bionic_heap_usage_error(const char* function, void* address) {
// So that we can get a memory dump around the specific address.
*((int**) 0xdeadbaad) = (int*) address;
}
-
-static int __ashmem_create_region(const char* name, size_t size) {
- int fd = open("/dev/ashmem", O_RDWR);
- if (fd == -1) {
- return fd;
- }
- int rc = ioctl(fd, ASHMEM_SET_NAME, name);
- if (rc < 0) {
- close(fd);
- return rc;
- }
- rc = ioctl(fd, ASHMEM_SET_SIZE, size);
- if (rc < 0) {
- close(fd);
- return rc;
- }
- return fd;
-}
-
-static void* __bionic_named_anonymous_mmap(size_t length) {
- int fd = __ashmem_create_region("libc malloc", length);
- if (fd < 0) {
- return MAP_FAILED;
- }
- void* result = mmap(NULL, length, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
- close (fd);
- return result;
-}