зеркало из https://github.com/mozilla/gecko-dev.git
Bug 799849: Wrap nothrow libstdc++ allocators. r=glandium a=blocking-basecamp
This commit is contained in:
Родитель
92c1b2fb10
Коммит
a7efca8c8a
|
@ -7153,6 +7153,8 @@ if test -n "$_WRAP_MALLOC"; then
|
|||
dnl Wrap operator new and operator delete on Android.
|
||||
if test "$OS_TARGET" = "Android"; then
|
||||
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=_Znwj,--wrap=_Znaj,--wrap=_ZdlPv,--wrap=_ZdaPv"
|
||||
dnl Wrap the nothrow variants too.
|
||||
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=_ZnwjRKSt9nothrow_t,--wrap=_ZnajRKSt9nothrow_t,--wrap=_ZdlPvRKSt9nothrow_t,--wrap=_ZdaPvRKSt9nothrow_t"
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([--enable-wrap-malloc is not supported for non-GNU toolchains])
|
||||
|
|
|
@ -43,6 +43,30 @@ wrap(_ZdaPv)(void *ptr)
|
|||
{
|
||||
wrap(free)(ptr);
|
||||
}
|
||||
/*operator new(unsigned int, std::nothrow_t const&)*/
|
||||
MOZ_EXPORT_API(void *)
|
||||
wrap(_ZnwjRKSt9nothrow_t)(unsigned int size)
|
||||
{
|
||||
return wrap(malloc)(size);
|
||||
}
|
||||
/*operator new[](unsigned int, std::nothrow_t const&)*/
|
||||
MOZ_EXPORT_API(void *)
|
||||
wrap(_ZnajRKSt9nothrow_t)(unsigned int size)
|
||||
{
|
||||
return wrap(malloc)(size);
|
||||
}
|
||||
/* operator delete(void*, std::nothrow_t const&) */
|
||||
MOZ_EXPORT_API(void)
|
||||
wrap(_ZdlPvRKSt9nothrow_t)(void *ptr)
|
||||
{
|
||||
wrap(free)(ptr);
|
||||
}
|
||||
/* operator delete[](void*, std::nothrow_t const&) */
|
||||
MOZ_EXPORT_API(void)
|
||||
wrap(_ZdaPvRKSt9nothrow_t)(void *ptr)
|
||||
{
|
||||
wrap(free)(ptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef wrap
|
||||
|
|
Загрузка…
Ссылка в новой задаче