Allocate memory in SkTDynamicHash on first use.
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 13 Jan 2014 18:28:14 +0000 (18:28 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 13 Jan 2014 18:28:14 +0000 (18:28 +0000)
commit7a4b9fab286c3c02cca433c2ca36ebd35377de46
tree0b370cd685b2c24a6606f1a57311c2e5716edf6c
parent85195486939b19a88b25b3ba0a1ad6640980fb5a
Allocate memory in SkTDynamicHash on first use.

This eliminates any dynamic allocation for hash tables that are never used.
This helps SkPicture, where some tables (SkPaint) are almost always used, but
some rarely (SkMatrix) or never (SkRegion).

This also removes the (as yet unimportant) ability for the hash table to
shrink.  This makes resizing harder to reason about, so I'd like to leave it
out until we see a need.

BUG=skia:1850
R=tomhudson@chromium.org, reed@google.com

Author: mtklein@google.com

Review URL: https://codereview.chromium.org/136403004

git-svn-id: http://skia.googlecode.com/svn/trunk@13051 2bbb7eff-a529-9590-31e7-b0007b416f81
src/core/SkTDynamicHash.h
tests/DynamicHashTest.cpp