[cxx-abi-dev] __cxa_demangle memory ownership issue

Dennis Handly dhandly at cup.hp.com
Thu Jan 20 06:31:46 UTC 2011


>From: Howard Hinnant <hhinnant at apple.com>
>char* __cxa_demangle(const char* mangled_name, char* buf, size_t* n,
>				   int* status);

>If buf and n are non-null and if __cxa_demangle returns NULL (e.g.
>because of an invalid mangled_name), does __cxa_demangle free(buf) or
>not?  The spec seems ambiguous on this point.

My implementation never frees anything unless it is too small.

The spec isn't ambiguous if you assume you do ONLY what is mentioned under
Memory management.



More information about the cxx-abi-dev mailing list