================ @@ -25,14 +25,19 @@ enum CXStringFlag { /// CXString contains a 'const char *' that it doesn't own. CXS_Unmanaged, - /// CXString contains a 'const char *' that it allocated with malloc(). - CXS_Malloc, + /// CXString contains a 'CStringImpl' that it allocated with malloc(). + CXS_MallocWithSize, /// CXString contains a CXStringBuf that needs to be returned to the /// CXStringPool. CXS_StringBuf }; +struct CStringImpl { + size_t length; + char buffer[sizeof(length)]; ---------------- xTachyon wrote:
I'll look at that class when I get the time, but just allocating the data without making a struct seems straight forward enough. I also need to see why tests fail while I'm at it. https://github.com/llvm/llvm-project/pull/134551 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits