mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 4230d328b65f (bug 801571) for memory leaks.
This commit is contained in:
parent
9aca2e7e9a
commit
41ae41c2b0
@ -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=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=__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=strdup,--wrap=strndup"
|
||||||
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=vasprintf,--wrap=asprintf"
|
|
||||||
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size"
|
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size"
|
||||||
dnl Wrap operator new and operator delete on Android.
|
dnl Wrap operator new and operator delete on Android.
|
||||||
if test "$OS_TARGET" = "Android"; then
|
if test "$OS_TARGET" = "Android"; then
|
||||||
|
@ -88,51 +88,6 @@ strdup_impl(const char *src)
|
|||||||
}
|
}
|
||||||
#endif /* XP_DARWIN */
|
#endif /* XP_DARWIN */
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
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
|
#ifdef XP_WIN
|
||||||
/*
|
/*
|
||||||
* There's a fun allocator mismatch in (at least) the VS 2010 CRT
|
* There's a fun allocator mismatch in (at least) the VS 2010 CRT
|
||||||
|
@ -212,15 +212,6 @@
|
|||||||
# define wcsdup_impl mozmem_dup_impl(wcsdup)
|
# define wcsdup_impl mozmem_dup_impl(wcsdup)
|
||||||
#endif
|
#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 */
|
/* Jemalloc specific function */
|
||||||
#define jemalloc_stats_impl mozmem_jemalloc_impl(jemalloc_stats)
|
#define jemalloc_stats_impl mozmem_jemalloc_impl(jemalloc_stats)
|
||||||
#define jemalloc_purge_freed_pages_impl mozmem_jemalloc_impl(jemalloc_purge_freed_pages)
|
#define jemalloc_purge_freed_pages_impl mozmem_jemalloc_impl(jemalloc_purge_freed_pages)
|
||||||
|
Loading…
Reference in New Issue
Block a user