Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: src/cxa_demangle.cpp

Issue 102883003: Don't ship a full C++ demangler as part of libc++abi (Closed) Base URL: http://git.chromium.org/native_client/pnacl-libcxxabi.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cxa_demangle.cpp
diff --git a/src/cxa_demangle.cpp b/src/cxa_demangle.cpp
index ba8225cfd2d5363ac95a06f479fe0f7b21f6a81b..f9971898d99dedfebfba4305c67f6270c2e91f6b 100644
--- a/src/cxa_demangle.cpp
+++ b/src/cxa_demangle.cpp
@@ -4598,6 +4598,16 @@ extern "C"
char*
__cxa_demangle(const char* mangled_name, char* buf, size_t* n, int* status)
{
+ // @LOCALMOD-START
+ // The demangler is *huge* and only used in default_terminate_handler
+ // with a fallback to printing mangled names instead. pexe size
+ // matters a lot, so PNaCl only prints out mangled names when
+ // exceptions are uncaught.
+#ifdef __pnacl__
+ *status = 1;
jvoung (off chromium) 2013/12/04 01:52:00 The API says that status may be a null pointer (in
JF 2013/12/04 02:10:25 I fixed this and also moved the code down so it st
+ return 0;
+#else
+ // @LOCALMOD-END
if (mangled_name == nullptr || (buf != nullptr && n == nullptr))
{
if (status)
@@ -4681,6 +4691,9 @@ __cxa_demangle(const char* mangled_name, char* buf, size_t* n, int* status)
if (status)
*status = internal_status;
return buf;
+ // @LOCALMOD-START
+#endif // __pnacl__
+ // @LOCALMOD-END
}
} // __cxxabiv1
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698