Commit 5c3d9743 authored by tzik's avatar tzik Committed by Commit Bot

Relax default kCanClearUnusedSlotsWithMemset condition

This CL marks non-tracable trivially_destructible objects as
kCanClearUnusedSlotsWithMemset, so that such a class can be stored in
a HeapVector.

Change-Id: Ia4c7a0d0fe7d089d8e9b4446366699ae81554842
Reviewed-on: https://chromium-review.googlesource.com/896763Reviewed-by: default avatarKeishi Hattori <keishi@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533629}
parent 7cdabea1
...@@ -42,9 +42,9 @@ struct VectorTraitsBase { ...@@ -42,9 +42,9 @@ struct VectorTraitsBase {
// slot in the vector's backing storage; it does not have to be equal to // slot in the vector's backing storage; it does not have to be equal to
// what its constructor(s) would create, only be valid for those two uses. // what its constructor(s) would create, only be valid for those two uses.
static constexpr bool kCanClearUnusedSlotsWithMemset = static constexpr bool kCanClearUnusedSlotsWithMemset =
std::is_trivially_constructible<T>::value &&
std::is_trivially_destructible<T>::value && std::is_trivially_destructible<T>::value &&
std::is_trivially_copyable<T>::value; (!IsTraceable<T>::value || (std::is_trivially_constructible<T>::value &&
std::is_trivially_copyable<T>::value));
static constexpr bool kCanMoveWithMemcpy = static constexpr bool kCanMoveWithMemcpy =
std::is_trivially_move_assignable<T>::value; std::is_trivially_move_assignable<T>::value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment