mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-30 16:28:30 +00:00
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:
parent
a6ecbb747d
commit
57c0b065c8
10 changed files with 42326 additions and 1979 deletions
|
@ -6,6 +6,8 @@ errno_t cosmo_once(_Atomic(uint32_t) *, void (*)(void));
|
|||
int systemvpe(const char *, char *const[], char *const[]) libcesque;
|
||||
char *GetProgramExecutableName(void);
|
||||
void unleaf(void);
|
||||
int __demangle(char *, const char *, size_t);
|
||||
int __is_mangled(const char *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_COSMO_H_ */
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -110,9 +110,9 @@ void *_mapanon(size_t) attributeallocsize((1)) mallocesque;
|
|||
void *_mapshared(size_t) attributeallocsize((1)) mallocesque;
|
||||
void CheckForMemoryLeaks(void);
|
||||
void CheckForFileLeaks(void);
|
||||
bool32 _isheap(const void *);
|
||||
void __enable_threads(void);
|
||||
void __oom_hook(size_t);
|
||||
bool32 _isheap(void *);
|
||||
/* code morphing */
|
||||
void __morph_begin(void);
|
||||
void __morph_end(void);
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue