Commit 1262518
committed
[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://1102617121 parent 582946b commit 1262518
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
889 | | - | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
890 | 893 | | |
891 | 894 | | |
892 | 895 | | |
| |||
0 commit comments