__cxa_demangle memory ownership issue

Howard Hinnant hhinnant at apple.com
Wed Jan 19 17:30:39 UTC 2011


Given:

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.

Thanks,
Howard




More information about the cxx-abi-dev mailing list