Export of internal Abseil changes.

--
2ee5dbb79b56539b580c3a36eec5a025d08b7022 by Eric Fiselier <ericwf@google.com>:

Unconditionally apply no-sanitize attributes.

We currently fail to apply the attributes in open-source
land because the build system doesn't define ADDRESS_SANITIZER
like we expect.

The attributes should have no effect when the sanitizers are
disabled.

PiperOrigin-RevId: 255024122

--
5a123175146de14d04013862aa378f28f8eff73c by CJ Johnson <johnsoncj@google.com>:

Updates the InputIterator-accepting member functions of InlinedVector to be cleaner/easier to read

PiperOrigin-RevId: 254994794

--
a4bdb61407a76317810785a34e49f996699ab4a4 by Abseil Team <absl-team@google.com>:

Added back c_move_backward which was previously deleted by mistake.

PiperOrigin-RevId: 254990809

--
bc427ca5f7fb88a70ba3a676bb9c7ff829c65ae9 by CJ Johnson <johnsoncj@google.com>:

Removes DestroyAndDeallocate() function from the internal details of InlinedVector because it ended up not being particularly useful

PiperOrigin-RevId: 254981201
GitOrigin-RevId: 2ee5dbb79b56539b580c3a36eec5a025d08b7022
Change-Id: I825c6c0a2fcf13ed6e60d71224037a57d7068d55
This commit is contained in:
Abseil Team 2019-06-25 12:32:44 -07:00 committed by Shaindel Schwartz
parent d65e19dfcd
commit 72e09a54d9
5 changed files with 49 additions and 25 deletions

View file

@ -275,7 +275,11 @@ class Storage {
explicit Storage(const allocator_type& alloc)
: metadata_(alloc, /* empty and inlined */ 0) {}
~Storage() { DestroyAndDeallocate(); }
~Storage() {
pointer data = GetIsAllocated() ? GetAllocatedData() : GetInlinedData();
inlined_vector_internal::DestroyElements(GetAllocPtr(), data, GetSize());
DeallocateIfAllocated();
}
size_type GetSize() const { return GetSizeAndIsAllocated() >> 1; }
@ -377,8 +381,6 @@ class Storage {
data_ = other_storage.data_;
}
void DestroyAndDeallocate();
template <typename ValueAdapter>
void Initialize(ValueAdapter values, size_type new_size);
@ -432,14 +434,6 @@ class Storage {
Data data_;
};
template <typename T, size_t N, typename A>
void Storage<T, N, A>::DestroyAndDeallocate() {
inlined_vector_internal::DestroyElements(
GetAllocPtr(), (GetIsAllocated() ? GetAllocatedData() : GetInlinedData()),
GetSize());
DeallocateIfAllocated();
}
template <typename T, size_t N, typename A>
template <typename ValueAdapter>
auto Storage<T, N, A>::Initialize(ValueAdapter values, size_type new_size)