mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 20:21:21 +00:00
[android] Override __cxa_demangle() in PRODUCT mode
Saves at least 90KB of binary size. Change-Id: I9f40cc9fbd3a80421ed5f4b751e47f593cb8d1d5 Reviewed-on: https://dart-review.googlesource.com/11344 Reviewed-by: Siva Annamalai <asiva@google.com>
This commit is contained in:
parent
cdbd085119
commit
9fce277b7e
|
@ -10,6 +10,21 @@
|
||||||
#include <cxxabi.h> // NOLINT
|
#include <cxxabi.h> // NOLINT
|
||||||
#include <dlfcn.h> // NOLINT
|
#include <dlfcn.h> // NOLINT
|
||||||
|
|
||||||
|
// Even though it's not used in a PRODUCT build, __cxa_demangle() still ends up
|
||||||
|
// in the resulting binary for Android. Blowing it away by redefining it like
|
||||||
|
// so saves >90KB of binary size.
|
||||||
|
#if defined(PRODUCT)
|
||||||
|
extern "C" char* __cxa_demangle(const char* mangled_name,
|
||||||
|
char* buf,
|
||||||
|
size_t* n,
|
||||||
|
int* status) {
|
||||||
|
if (status) {
|
||||||
|
*status = -1;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace dart {
|
namespace dart {
|
||||||
|
|
||||||
void NativeSymbolResolver::InitOnce() {}
|
void NativeSymbolResolver::InitOnce() {}
|
||||||
|
|
Loading…
Reference in a new issue