Make old C++ demangler asynchronous signal safe

It's now possible to safely print C++ backtraces from signal handlers.
This symbol demangler doesn't need malloc, tls, or even static memory.
Additionally, this change makes it 2x faster and adds test cases. It's
almost as performant and accurate as the libcxxabi implementation now.
This commit is contained in:
Justine Tunney 2024-05-07 03:06:12 -07:00
parent a6ecbb747d
commit 57c0b065c8
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
10 changed files with 42326 additions and 1979 deletions

View file

@ -29,7 +29,7 @@
* @assume stack memory isn't stored beneath %rsp (-mno-red-zone)
* @deprecated
*/
optimizesize bool32 _isheap(void *p) {
optimizesize bool32 _isheap(const void *p) {
intptr_t x, y;
x = kAutomapStart;
y = x + kAutomapSize;