1 | | I may have identified a workaround for this issue. Compiling src/3rdparty/chromium/base/strings/string16.cc separately (by adding it to `jumbo_excluded_sources` in src/3rdparty/chromium/base/BUILD.gn) outputs src/core/release/obj/base/base/string16.o, which appears to reliably contain `base::string16::reserve(unsigned long)`. `shrink_to_fit()`, `reserve()`, and `reserve(0)` are equivalent in C++17 and earlier (various versions of libc++ have even implemented `shrink_to_fit()` as `reserve()` or vice versa in the include/c++/v1/string header file). Since string16.cc is currently being compiled with `-std=c++14`, I would try replacing `dest_str->shrink_to_fit()` with `dest_str->reserve(0)` in src/3rdparty/chromium/base/strings/utf_string_conversions.cc (~~I don’t know if it looks silly to do `reserve(0)` right after doing `reserve(dest_len32)`~~ misread `resize(dest_len32)`, which would not be the same as `reserve(dest_len32)`). |
| 1 | I may have identified a workaround for this issue. Compiling src/3rdparty/chromium/base/strings/string16.cc separately (by adding it to `jumbo_excluded_sources` in src/3rdparty/chromium/base/BUILD.gn) outputs src/core/release/obj/base/base/string16.o, which appears to reliably contain `base::string16::reserve(unsigned long)`. `shrink_to_fit()`, `reserve()`, and `reserve(0)` are equivalent in C++17 and earlier (various versions of libc++ have even implemented `shrink_to_fit()` as `reserve()` or vice versa in the include/c++/v1/string header file). Since string16.cc is currently being compiled with `-std=c++14`, I would try replacing `dest_str->shrink_to_fit()` with `dest_str->reserve(0)` in src/3rdparty/chromium/base/strings/utf_string_conversions.cc (~~I don’t know if it looks silly to do `reserve(0)` right after doing `reserve(dest_len32)`~~ edit: misread `resize(dest_len32)`, which would not be the same as `reserve(dest_len32)`). |