[PATCH] D106753: ConvertUTF: Created wrapper convertUTF32ToUTF8String

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 27 16:12:43 PDT 2021


efriedma added inline comments.


================
Comment at: llvm/lib/Support/ConvertUTFWrapper.cpp:176
+  // enough that we can fit a null terminator without reallocating.
+  Out.resize(SrcBytes.size() * UNI_MAX_UTF8_BYTES_PER_CODE_POINT + 1);
+  UTF8 *Dst = reinterpret_cast<UTF8 *>(&Out[0]);
----------------
`SrcBytes.size() * UNI_MAX_UTF8_BYTES_PER_CODE_POINT + 1` seems like way too much memory.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106753/new/

https://reviews.llvm.org/D106753



More information about the cfe-commits mailing list