aboutsummaryrefslogtreecommitdiffstats
path: root/libc/bionic/dlmalloc.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix dlmalloc build.Dan Albert2014-08-221-2/+2
| | | | Change-Id: Ied542c40867ab443cdd2076bd2e535b00c4854e4
* Implement malloc_info(3).Dan Albert2014-08-221-0/+23
| | | | | | | Expose jemalloc stats through the malloc_info(3) interface. Bug: 16874689 Change-Id: I4358ac283002e60ff161107028d1a3fb1e9afb0a
* Label pages mapped by linker_allocatorDmitriy Ivanov2014-08-111-5/+1
| | | | Change-Id: I7e0bf29bc1a480e9be0d1ae573ca1063d90d82ff
* Fix private/bionic_name_mem.h build breakage.Elliott Hughes2014-07-171-2/+1
| | | | Change-Id: I8fe9c63dbbb5911721ca56791c0bff4bdf403314
* Remove non-standard prctl constants from <sys/prctl.h>.Elliott Hughes2014-07-171-2/+7
| | | | | | | 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
* Hide dlmalloc symbols.Elliott Hughes2014-06-031-10/+7
| | | | | | | | | We need to leave dlmalloc_trim and dlmalloc_inspect_all exposed for the VM, but if we're seriously looking at other malloc implementations, that's something we're going to have to fix. Bug: 11156955 Change-Id: If85156c280044f1616c09a3c50ba674aaf0e8d3a
* Register _cleanup function with atexitDmitriy Ivanov2014-05-151-3/+0
| | | | | | | | | | | | | | | | * Register cleanup function with atexit instead of calling it explicitly on exit() * abort() no longer calls _cleanup: Flushing stdio buffers on abort is no longer required by POSIX. * dlmalloc no longer need to reset cleanup (see above) * Upstream findfp.c makebuf.c setvbuf.cexit.c to openbsd versions. Bug: 14415367 Change-Id: I277058852485a9d3dbb13e5c232db5f9948d78ac
* bionic: name malloc'd regionsColin Cross2013-08-081-0/+18
| | | | | | | Use the new __bionic_name_mem function to name malloc'd memory as "libc_malloc" on kernels that support it. Change-Id: I7235eae6918fa107010039b9ab8b7cb362212272
* Clean up abort.Elliott Hughes2013-06-121-3/+7
| | | | | | | | | | | | | | | | | | * A dlmalloc usage error shouldn't call abort(3) because we want to cause a SIGSEGV by writing the address dlmalloc didn't like to an address the kernel won't like, so that debuggerd will dump the memory around the address that upset dlmalloc. * Switch to the simpler FreeBSD/NetBSD style of registering stdio cleanup. Hopefully this will let us simplify more of the stdio implementation. * Clear the stdio cleanup handler before we abort because of a dlmalloc corruption error. This fixes the reported bug, where we'd hang inside dlmalloc because the stdio cleanup reentered dlmalloc. Bug: 9301265 Change-Id: Ief31b389455d6876e5a68f0f5429567d37277dbc
* Make abort messages available to debuggerd.Elliott Hughes2013-04-051-15/+4
| | | | | | | | | | | | | This adds __libc_fatal, cleans up the internal logging code a bit more, and switches suitable callers over to __libc_fatal. In addition to logging, __libc_fatal stashes the message somewhere that the debuggerd signal handler can find it before calling abort. In the debuggerd signal handler, we pass this address to debuggerd so that it can come back with ptrace to read the message and present it to the user. Bug: 8531731 Change-Id: I416ec1da38a8a1b0d0a582ccd7c8aaa681ed4a29
* Stop using unreasonable numbers of map entries.Elliott Hughes2013-04-021-32/+0
| | | | | Bug: 8460659 Change-Id: Ib0ee71e3cf61e122d0449c9d8a4e4670a7d7129a
* Clarify the dlmalloc USAGE_ERROR.Elliott Hughes2013-03-251-1/+2
| | | | | Bug: 8468088 Change-Id: I1ff6d51ec17fc74ef56229aa76d2986cbd662874
* Clean up internal libc logging.Elliott Hughes2013-03-151-2/+1
| | | | | | | | | | | We only need one logging API, and I prefer the one that does no allocation and is thus safe to use in any context. Also use O_CLOEXEC when opening the /dev/log files. Move everything logging-related into one header file. Change-Id: Ic1e3ea8e9b910dc29df351bff6c0aa4db26fbb58
* Use the new non-allocating logging for dlmalloc failures.Elliott Hughes2013-01-221-86/+52
| | | | Change-Id: I88afe0201ee5766a295fc5a9e710fba9d6e0d363
* Name anonymous mmap mallocs.Ian Rogers2013-01-111-0/+41
| | | | Change-Id: Icc53ba1eecb8445210623826d8e99a611d686f7f
* Revert "Revert "Upgrade to dlmalloc 2.8.5.""Ian Rogers2012-08-281-5494/+25
| | | | This reverts commit f72ee269274170cd46af2844a2fe88767fb6e43c.
* Revert "Upgrade to dlmalloc 2.8.5."Brian Carlstrom2012-08-221-25/+5494
| | | | This reverts commit 999089181ef60bb67e1a49f2cf6f4ec608a7caf8.
* Upgrade to dlmalloc 2.8.5.Ian Rogers2012-08-201-5494/+25
| | | | | | | | | | Move dlmalloc code to upstream-dlmalloc to make pulling upstream changes easier. Declare pvalloc and malloc_usable_size routines present in malloc.h but with missing implementations. Remove other functions from malloc.h that have no implementation nor use in Android. Change-Id: Ia6472ec6cbebc9ad1ef99f4669de9d33fcc2efb4
* Minor tweak to get memory around corrupted heap chunks dumped.Ben Cheng2012-06-191-20/+22
| | | | Change-Id: I8f72c5c7e23960b13fc53e2354cd74aca8aac3c0
* Print the corrupted address passed to free().Ben Cheng2012-05-241-3/+26
| | | | | | | | | | | For example: @@@ ABORTING: INVALID HEAP ADDRESS IN dlfree addr=0x5c3bfbd0 Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 2942 The addr=0x5c3bfbd0 part is new. Change-Id: I8670144b2b0a3a6182384150d762c97dfee5452f
* Initialize mspace->least_addr properly in the mmap path.Ben Cheng2012-03-211-2/+4
| | | | | BUG: 6206963 Change-Id: Id2ab580246de50a4511b56a734a7bece98fb945c
* Add the posix_memalign(3) function to bionicKen Sumrall2011-12-141-0/+28
| | | | | | | | | | The posix_memalign(3) function is very similar to the traditional memalign(3) function, but with better error reporting and a guarantee that the memory it allocates can be freed. In bionic, memalign(3) allocated memory can be freed, so posix_memalign(3) is just a wrapper around memalign(3). Change-Id: I62ee908aa5ba6b887d8446a00d8298d080a6a299
* Really fix the build.David 'Digit' Turner2011-07-061-3/+3
| | | | | | | | libcutils/mspace.c includes libc/bionic/dlmalloc.c, we need to take care of the fact that any internal C library function cannot be used from it. Change-Id: I0bc81ae090b7ac2d464f26b97fc6b94a08cdad9c
* Fix broken buildDavid 'Digit' Turner2011-07-061-1/+1
| | | | Change-Id: Ia46b50aec51a55434c8828a73e07f4732f8f6c1c
* libc: Add logcat error message for memory corruptionDavid 'Digit' Turner2011-07-051-6/+46
| | | | | | | | | | | | | | | | | | Our dlmalloc implementation currently calls abort() when it detects that the heap is corrupted, or that an invalid pointer is passed to one of its functions. The only way to detect this is because abort() will force-fully crash the current program with a magic fault address of '0xdeadbaad'. However, this is not really well documented, and a frequent topic on the android-ndk forum (among others). This change makes our dlmalloc code dump a simple message to the log just before the abort() call (and hence before the stack trace) to better help identify the problem. Change-Id: Iebf7eb7fe26463ecadfaca8f247d237edb441e3c
* Split libc_debug.so into two .so modules loaded on demand from libc.soVladimir Chtchetkine2009-11-181-8/+8
| | | | | This change is intended to eliminate need to replace libc.so with libc_debug.so in order to enablememory allocation debugging. This is also the first step towards implementing extended memoryallocation debugging using emulator's capabilities in monitoring memory access.
* Add mspace_merge_objectsBarry Hayes2009-06-021-0/+73
|
* Initial Contributionandroid-1.0The Android Open Source Project2008-10-211-0/+5377