History log of /system/core/include/utils/TypeHelpers.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
58bf572aa2060ad30a8e46dd0b4a5cf9bb748f85 14-Jun-2015 Nick Kralevich <nnk@google.com> TypeHelpers.h: Don't underflow unsigned int

When decrementing "n", eventually n will equal zero. When that
happens, n-- underflows. This causes a crash when code which uses
clang's -fsanitize=unsigned-integer-overflow is run.

Avoid trigging an unsigned integer underflow.

Change-Id: I9705be6580d61a164ef5fb1ec77e98a69d888438
/system/core/include/utils/TypeHelpers.h
b6ea175b6b4d0aaac85ed6cd8ccac01ab896486b 26-Oct-2012 Raph Levien <raph@google.com> Add an LRU cache plus hashing primitives

This patch adds a hashtable-based LRU cache. This should be
significantly higher performance than the GenerationCache it is intended
to replace. It is a large part of the fix for bug 7271109
TextLayoutCache low-level performance issues.

We added a new method to BasicHashtable to detect when rehashing is
needed, because the internal linked list pointers would get invalidated
by that rehashing.

Also, the hash_type specialized to pointers had a small flaw.

Change-Id: I950c2083f96519777b851dbe157100e0a334caec
/system/core/include/utils/TypeHelpers.h
9a0a76df1e961ef4621e81814d8bf891a09bef66 16-Mar-2012 Jeff Brown <jeffbrown@google.com> Add traits to common utils data structures.

Many of our basic data structures are trivially movable using
memcpy() even if they are not trivially constructable, destructable
or copyable. It's worth taking advantage of this *ahem* trait.

Adding trivial_move_trait to String16 reduces appt running
time on frameworks/base/core/res by 40%!

Change-Id: I630a1a027e2d0ded96856e4ca042ea82906289fe
/system/core/include/utils/TypeHelpers.h
4cc144c4fbbcef72b1af3ec3ea86356790397025 13-Jan-2012 Evgeniy Stepanov <eugenis@google.com> Fix compilation with Clang.

warning: extraneous template parameter list in template specialization
template<>

Change-Id: If3e3e1d06a018343b40ac0984dfd9ecc12629f8d
/system/core/include/utils/TypeHelpers.h
142dbcd817ac7960061735e5e7ea174e0938fb09 24-Nov-2011 Jeff Brown <jeffbrown@google.com> Use sized integer typedefs in hash_type specializations.

Change-Id: I3f9e004db2f3be1cb43a885c3ae142f251fd6845
/system/core/include/utils/TypeHelpers.h
e735f23018b398f45bd052b63616d7a45e29515b 15-Nov-2011 Jeff Brown <jeffbrown@google.com> Add a basic hashtable data structure, with tests!

The basic hashtable is intended to be used to support a variety
of different datastructures such as map, set, multimap,
multiset, linkedmap, generationcache, etc.

Consequently its interface is fairly primitive.

The basic hashtable supports copy-on-write style functionality
using SharedBuffer.

The change introduces a simple generic function in TypeHelpers for
specifying hash functions. The idea is to add template
specializations of hash_type<T> next to the relevant data structures
such as String8, String16, sp<T>, etc.

Change-Id: I2c479229e9d4527b4fbfe3b8b04776a2fd32c973
/system/core/include/utils/TypeHelpers.h
b26ea8b30f11cf0ad11ac7983208514a1bfafb75 17-Feb-2011 Mathias Agopian <mathias@google.com> Fix some issues with RefBase debugging.

First slipt sp<> out of RefBase into StrongPointer.h so it can be reused
more easily and to make it clear that it doesn't require RefBase.

Note: the rest of the change only affects the system when DEBUG_REFS is enabled.

The main problem we fix here is that the owner id associated with each
reference could get out of date when a sp<> or wp<> was moved, for
instance when they're used in a Vector< >.

We fix this issue by calling into RefBase::moveReferences from
a template specialization for sp<TYPE> and wp<TYPE> of the
type helpers. RefBase::moveReferences() has then a chance to
update the owner ids.

There is a little bit of trickery to implement this generically in
RefBase, where we need to use a templatized functor that can turn
a sp<TYPE>* casted to a void* into a RefBase*.

Introduced a new debug option DEBUG_REFS_FATAL_SANITY_CHECKS
currently set to 0 by default as there seem to be an issue
with sp<ANativeWindow> which trips the sanity checks.

Change-Id: I4825b21c8ec47d4a0ef35d760760ae0c9cdfbd7f
/system/core/include/utils/TypeHelpers.h
a33bd1672fab3ac2ca72f2921716bf860d500aa3 22-Jun-2009 Mathias Agopian <mathias@google.com> improve Vector<> with types that can be trivially moved and remove some unused code.

This optimization applies to sp<> and wp<> which should now perform about the same as regular pointers when placed in to Vector<>.
/system/core/include/utils/TypeHelpers.h
cbb1011c95e0c25c29e40e203a6a31bccd029da3 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/system/core/include/utils/TypeHelpers.h
cf59fa8dc7ddca5a172860223b06afed5d4ec0e0 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/system/core/include/utils/TypeHelpers.h
d245d1d09731d6a19e8a25559d3907f54441ac3d 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/system/core/include/utils/TypeHelpers.h