Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38d36e44 authored by Steven Moreland's avatar Steven Moreland
Browse files

libutils: T* is a trivial type

Avoid calling constructors/destructors for
each element, when we have Vector<T*>. These
are used in libbinder and elsewhere.

std::vector is still faster but uses more mem.

Bugs: me
Test: boot && binderLibTest
Change-Id: Id1239daddd018f8eee5480d1cb6dd25d6f4df808
parent 6d6ff398
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -109,6 +109,11 @@ ANDROID_BASIC_TYPES_TRAITS( unsigned long long )
ANDROID_BASIC_TYPES_TRAITS( float )
ANDROID_BASIC_TYPES_TRAITS( double )

template<typename T> struct trait_trivial_ctor<T*>   { enum { value = true }; };
template<typename T> struct trait_trivial_dtor<T*>   { enum { value = true }; };
template<typename T> struct trait_trivial_copy<T*>   { enum { value = true }; };
template<typename T> struct trait_trivial_move<T*>   { enum { value = true }; };

// ---------------------------------------------------------------------------