inlined_vector: Use trivial relocation for erase#1615
inlined_vector: Use trivial relocation for erase#1615Quuxplusone wants to merge 0 commit intoabseil:masterfrom
erase#1615Conversation
826048e to
0f17a16
Compare
7ff3427 to
e755f34
Compare
|
@derekmauro : Hm, I figured out (by building locally) that the earlier build failure was that I'd typoed |
|
I know there is a way to make the build links public but I think there is some work involved. I'll just copy the error for you. |
|
Oh, I see! My brain mismatched the parens in Abseil actually is using Clang's or at best Would either of those be acceptable here? |
e755f34 to
3633806
Compare
derekmauro
left a comment
There was a problem hiding this comment.
I think this PR is addressing 2 issues:
- Bugs in the implementation of
absl::is_trivially_relocatable. - Using trivial relocation for
absl::InlinedVector::erase.
Would it be possible to split this into two PRs to address these two issues separately?
Both changes look fine on their own, though I will have to run them though the global tests before importing.
Definitely, will do. (I'll create a new PR for "bugs in the implementation/tests" and leave this one's title accurate.) |
|
@derekmauro: Okay, I've split out #1625 as a first step / prerequisite. Now I'm going to update this one (#1615) to just optimize |
341ab0c to
567de71
Compare
|
This is now triggering a GCC warning: I've seen this before in this file and I concluded it was a false positive, but I haven't had a chance to look at it closely yet. This is with GCC 13.2 and seems to require an optimized build to trigger. If you have a Linux machine with Docker, you can try it yourself with |
…ents` Imported from GitHub PR #1618 I noticed while working on #1615 that `inlined_vector` could use the trivial relocatability trait here, too. Here the memcpy codepath already exists; we just have to opt in to using it. Merge 567a1dd into a7012a5 Merging this change closes #1618 COPYBARA_INTEGRATE_REVIEW=#1618 from Quuxplusone:trivial-swap 567a1dd PiperOrigin-RevId: 609019296 Change-Id: I4055ab790245752179e405b490fcd479e7389726
941ea60 to
55d28d4
Compare
|
Sigh, I've completely failed at github. I tried resolving a merge conflict, screwed that up, and then somehow reverted everything, which caused github to close this. Mind opening a new PR? Sorry about this. |
…edElements` Imported from GitHub PR abseil#1618 I noticed while working on abseil#1615 that `inlined_vector` could use the trivial relocatability trait here, too. Here the memcpy codepath already exists; we just have to opt in to using it. Merge 567a1dd into a7012a5 Merging this change closes abseil#1618 COPYBARA_INTEGRATE_REVIEW=abseil#1618 from Quuxplusone:trivial-swap 567a1dd PiperOrigin-RevId: 609019296 Change-Id: I4055ab790245752179e405b490fcd479e7389726
Prior art for the
vector::eraseoptimization:https://github.com/AmadeusITGroup/amc/blob/efcb7be/include/amc/vectorcommon.hpp#L176-L180
https://github.com/bloomberg/bde/blob/e15f05be6/groups/bsl/bslalg/bslalg_arrayprimitives.h#L3787-L3799
https://github.com/facebook/folly/blob/d24bf04/folly/FBVector.h#L1254-L1262
https://github.com/qt/qtbase/blob/fbfee2d/src/corelib/tools/qarraydataops.h#L856-L861
attn @derekmauro @jacobsa