swift
1262518e - [Backtracing][Linux] Add a comment about __cxa_demangle.

Commit
2 years ago
[Backtracing][Linux] Add a comment about __cxa_demangle. `__cxa_demangle()` is a rather unusual API; one of its "features" is that the pointer you pass in must either be `nullptr`, in which case it will call `malloc()` itself, _or_ it has to be a pointer to a block of memory allocated with `malloc()`, because `__cxa_demangle()` may `realloc()` it for you. This seems to me to be something of a non-obvious footgun, so we never pass the caller's pointer through to `__cxa_demangle()`, which lets them decide how they want to allocate space. rdar://110261712
Author
Parents
Loading