From 097395532b8eb7310bac50597531f4551e2db636 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 22 Sep 2016 10:14:05 -0700 Subject: [PATCH] Remove has_trivial_move trait from Vector Vector objects are a dynamic type with a vtable, which is not trivially moveable. Impact on aapt for frameworks-res is negligible, ~3%. Bug: 31595853 Test: m -j framework-res Change-Id: I8a3269c35d95affb6e86d60588bcfca46db7f445 --- include/utils/KeyedVector.h | 7 ------- include/utils/SortedVector.h | 4 ---- include/utils/Vector.h | 4 ---- 3 files changed, 15 deletions(-) diff --git a/include/utils/KeyedVector.h b/include/utils/KeyedVector.h index c4faae0b7..44e9c08d4 100644 --- a/include/utils/KeyedVector.h +++ b/include/utils/KeyedVector.h @@ -97,13 +97,6 @@ private: SortedVector< key_value_pair_t > mVector; }; -// KeyedVector can be trivially moved using memcpy() because its -// underlying SortedVector can be trivially moved. -template struct trait_trivial_move > { - enum { value = trait_trivial_move > >::value }; -}; - - // --------------------------------------------------------------------------- /** diff --git a/include/utils/SortedVector.h b/include/utils/SortedVector.h index 2d3e82a7c..ea0f82c40 100644 --- a/include/utils/SortedVector.h +++ b/include/utils/SortedVector.h @@ -133,10 +133,6 @@ protected: virtual int do_compare(const void* lhs, const void* rhs) const; }; -// SortedVector can be trivially moved using memcpy() because moving does not -// require any change to the underlying SharedBuffer contents or reference count. -template struct trait_trivial_move > { enum { value = true }; }; - // --------------------------------------------------------------------------- // No user serviceable parts from here... // --------------------------------------------------------------------------- diff --git a/include/utils/Vector.h b/include/utils/Vector.h index ed7b72521..86800f562 100644 --- a/include/utils/Vector.h +++ b/include/utils/Vector.h @@ -207,10 +207,6 @@ protected: virtual void do_move_backward(void* dest, const void* from, size_t num) const; }; -// Vector can be trivially moved using memcpy() because moving does not -// require any change to the underlying SharedBuffer contents or reference count. -template struct trait_trivial_move > { enum { value = true }; }; - // --------------------------------------------------------------------------- // No user serviceable parts from here... // ---------------------------------------------------------------------------