[libcxx-commits] [PATCH] D138601: [libc++] Fix memory leaks when throwing inside std::vector constructors

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 1 14:38:18 PST 2022


philnik added inline comments.


================
Comment at: libcxx/include/vector:1256
 {
+    auto __guard = std::__make_transaction(__destroy_vector(*this));
     std::__debug_db_insert_c(this);
----------------
var-const wrote:
> Optional: maybe add a helper function so that this can be:
> ```
> auto __guard = __create_guard(*this);
> ```
> The expression is not super verbose, but it's repeated _a lot_.
TBH I don't think it's worth it. It's not like these are in any way complex.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138601



More information about the libcxx-commits mailing list