[libcxx-commits] [PATCH] D80588: Optimize vector push_back to avoid continuous load and store of end pointer.

Martijn Vels via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 29 12:00:44 PDT 2020


mvels added inline comments.


================
Comment at: libcxx/include/vector:949
+                                                    _Args&&... __args) {
+    _AsanTransaction tx(*this, 1);
+    __alloc_traits::construct(this->__alloc(), _VSTD::__to_address(__pos),
----------------
EricWF wrote:
> If this is the only place `_AsanTransaction` is used, does it need to be this complicated?
An alternative (imho more elegant) way to do this is in https://reviews.llvm.org/D80827

I like this better as emptying out the ASAN to empty thunks could remove much more #ifndef crud, and it evaporates entirely (guaranteed) when compiling with exceptions. (RAII has more cost then except if not part of a 'final' execution path)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80588





More information about the libcxx-commits mailing list