Merge "Export two dlmalloc functions everywhere."
This commit is contained in:
commit
d9dc13d417
@ -44,11 +44,13 @@
|
|||||||
#define dlmalloc dlmalloc_real
|
#define dlmalloc dlmalloc_real
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Export two symbols used by the VM. */
|
/* These two symbols are exported on devices that use dlmalloc.
|
||||||
__BEGIN_DECLS
|
* In order to be consistent across all devices, they will
|
||||||
int dlmalloc_trim(size_t) __LIBC_ABI_PUBLIC__;
|
* be exported everywhere. Move the real symbols out of the way
|
||||||
void dlmalloc_inspect_all(void (*handler)(void*, void*, size_t, void*), void*) __LIBC_ABI_PUBLIC__;
|
* so that ndk_cruft.cpp can export these symbols.
|
||||||
__END_DECLS
|
*/
|
||||||
|
#define dlmalloc_inspect_all dlmalloc_inspect_all_real
|
||||||
|
#define dlmalloc_trim dlmalloc_trim_real
|
||||||
|
|
||||||
/* Include the proper definitions. */
|
/* Include the proper definitions. */
|
||||||
#include "../upstream-dlmalloc/malloc.h"
|
#include "../upstream-dlmalloc/malloc.h"
|
||||||
|
@ -340,7 +340,7 @@ extern "C" pid_t __pthread_gettid(pthread_t t) {
|
|||||||
return pthread_gettid_np(t);
|
return pthread_gettid_np(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Older versions of appportable used dlmalloc directly instead of malloc,
|
// Older versions of apportable used dlmalloc directly instead of malloc,
|
||||||
// so export this compatibility shim that simply calls malloc.
|
// so export this compatibility shim that simply calls malloc.
|
||||||
extern "C" void* dlmalloc(size_t size) {
|
extern "C" void* dlmalloc(size_t size) {
|
||||||
return malloc(size);
|
return malloc(size);
|
||||||
@ -369,3 +369,26 @@ extern "C" void endusershell() { }
|
|||||||
|
|
||||||
// This is never implemented in bionic, only needed for ABI compatibility with the NDK.
|
// This is never implemented in bionic, only needed for ABI compatibility with the NDK.
|
||||||
extern "C" void endpwent() { }
|
extern "C" void endpwent() { }
|
||||||
|
|
||||||
|
// Since dlmalloc_inspect_all and dlmalloc_trim are exported for systems
|
||||||
|
// that use dlmalloc, be consistent and export them everywhere.
|
||||||
|
#if defined(USE_JEMALLOC)
|
||||||
|
extern "C" void dlmalloc_inspect_all(void (*)(void*, void*, size_t, void*), void*) {
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
extern "C" void dlmalloc_inspect_all_real(void (*)(void*, void*, size_t, void*), void*);
|
||||||
|
extern "C" void dlmalloc_inspect_all(void (*handler)(void*, void*, size_t, void*), void* arg) {
|
||||||
|
dlmalloc_inspect_all_real(handler, arg);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(USE_JEMALLOC)
|
||||||
|
extern "C" int dlmalloc_trim(size_t) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
extern "C" int dlmalloc_trim_real(size_t);
|
||||||
|
extern "C" int dlmalloc_trim(size_t pad) {
|
||||||
|
return dlmalloc_trim_real(pad);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user