From da06e090f6f42997cfa86d4c5ae57e4c61d7e435 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Fri, 17 Jan 2014 14:25:28 -0500 Subject: [PATCH] Backed out changeset 4230d328b65f (bug 801571) for memory leaks. --- configure.in | 1 - memory/build/mozmemory_wrap.c | 45 ----------------------------------- memory/build/mozmemory_wrap.h | 9 ------- 3 files changed, 55 deletions(-) diff --git a/configure.in b/configure.in index 06197856bc43..3c628457637b 100644 --- a/configure.in +++ b/configure.in @@ -7035,7 +7035,6 @@ if test -n "$_WRAP_MALLOC"; then WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign" WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete" WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup" - WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=vasprintf,--wrap=asprintf" WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size" dnl Wrap operator new and operator delete on Android. if test "$OS_TARGET" = "Android"; then diff --git a/memory/build/mozmemory_wrap.c b/memory/build/mozmemory_wrap.c index cbc6533f331b..5098d8911a9b 100644 --- a/memory/build/mozmemory_wrap.c +++ b/memory/build/mozmemory_wrap.c @@ -88,51 +88,6 @@ strdup_impl(const char *src) } #endif /* XP_DARWIN */ -#ifdef ANDROID -#include - -MOZ_MEMORY_API int -vasprintf_impl(char **str, const char *fmt, va_list ap) -{ - if (str == NULL || fmt == NULL) { - return -1; - } - - char* ptr = (char*)malloc_impl(128); - if (ptr == NULL) { - return -1; - } - - int ret = vsnprintf(ptr, 128, fmt, ap); - if (ret < 0) { - free_impl(ptr); - return ret; - } - - char* _ptr = realloc_impl(ptr, ret + 1); - if (_ptr == NULL) { - return -1; - } - - *str = _ptr; - - return ret; -} - -MOZ_MEMORY_API int -asprintf_impl(char **str, const char *fmt, ...) - { - va_list ap; - va_start(ap, fmt); - - int ret = vasprintf_impl(str, fmt, ap); - - va_end(ap); - - return ret; -} -#endif - #ifdef XP_WIN /* * There's a fun allocator mismatch in (at least) the VS 2010 CRT diff --git a/memory/build/mozmemory_wrap.h b/memory/build/mozmemory_wrap.h index 40abb041eac3..85eab2558633 100644 --- a/memory/build/mozmemory_wrap.h +++ b/memory/build/mozmemory_wrap.h @@ -212,15 +212,6 @@ # define wcsdup_impl mozmem_dup_impl(wcsdup) #endif -/* String functions */ -#ifdef ANDROID -/* Bug 801571 and Bug 879668, libstagefright uses vasprintf, causing malloc()/ - * free() to be mismatched between bionic and mozglue implementation. - */ -#define vasprintf_impl mozmem_dup_impl(vasprintf) -#define asprintf_impl mozmem_dup_impl(asprintf) -#endif - /* Jemalloc specific function */ #define jemalloc_stats_impl mozmem_jemalloc_impl(jemalloc_stats) #define jemalloc_purge_freed_pages_impl mozmem_jemalloc_impl(jemalloc_purge_freed_pages)