OSDN Git Service

Remove ViewTreeObserver allocations
authorRomain Guy <romainguy@google.com>
Mon, 7 May 2012 23:27:19 +0000 (16:27 -0700)
committerRomain Guy <romainguy@google.com>
Mon, 7 May 2012 23:30:54 +0000 (16:30 -0700)
commitb999cc118fe430699e9a67d5dab355125b873abb
tree394b40f16c8e99c9349464785a5d989eae28bd50
parentbae365c166538d5c2319bf42aaf1715a1fb749e7
Remove ViewTreeObserver allocations

This change replaces CopyOnWriteArrayList with a custom CopyOnWriteArray.
The new CopyOnWriteArray only allocates when a concurrent modification
is detected. Only one loop can iterate over CopyOnWriteArray at any
given time and the class is not thread safe.

Change-Id: Ie67a1ec20ff095350bf3c5d4f87cdb231ad57221
core/java/android/view/ViewTreeObserver.java