summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/wm/WindowManagerService.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2013-05-20 18:42:16 -0700
committerDianne Hackborn <hackbod@google.com>2013-05-24 16:36:14 -0700
commitf4bf0ae2a7c2d9d92c5c8abdb82baa53b4c9ccda (patch)
tree3e2b15a9b72cde690279e5650923b460109c66fc /services/java/com/android/server/wm/WindowManagerService.java
parentb631eda39cc53d88417fc0143ebfb08dc5dbc133 (diff)
New ArrayMap class.
This is a new kind of key/value mapping that stores its data as an array, so it doesn't need to create an extra Entry object for every mapping placed in to it. It is also optimized to reduce memory overhead in other ways, by keeping the base object small, being fairly aggressive about keeping the array data structures small, etc. There are some unit and performance tests dropped in to some random places; they will need to be put somewhere else once I decided what we are going to do with this for the next release (for example if we make it public the unit tests should go in to CTS). Switch IntentResolver to using ArrayMap instead of HashMap. Also get rid of a bunch of duplicate implementations of binarySearch, and add an optimization to the various sparse arrays where you can supply an explicit 0 capacity to prevent it from doing an initial array allocation; use this new optimization in a few places where it makes sense. Change-Id: I01ef2764680f8ae49938e2a2ed40dc01606a056b
Diffstat (limited to 'services/java/com/android/server/wm/WindowManagerService.java')
-rw-r--r--services/java/com/android/server/wm/WindowManagerService.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 3ebe083fb017..62141fd66eb8 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -424,7 +424,7 @@ public class WindowManagerService extends IWindowManager.Stub
String mLastANRState;
/** All DisplayContents in the world, kept here */
- private SparseArray<DisplayContent> mDisplayContents = new SparseArray<DisplayContent>();
+ private SparseArray<DisplayContent> mDisplayContents = new SparseArray<DisplayContent>(2);
private final AllWindowsIterator mTmpWindowsIterator = new AllWindowsIterator();