Fix bug in SkAutoSMalloc::reset

https://codereview.chromium.org/15858007/



git-svn-id: http://skia.googlecode.com/svn/trunk@9257 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
robertphillips@google.com 2013-05-23 14:59:40 +00:00
parent 0fb775cd77
commit 0f2b1953c7

View File

@ -588,7 +588,7 @@ public:
SkAutoMalloc::OnShrink shrink = SkAutoMalloc::kAlloc_OnShrink,
bool* didChangeAlloc = NULL) {
size = (size < kSize) ? kSize : size;
bool alloc = size != fSize && (SkAutoMalloc::kAlloc_OnShrink == shrink || size < fSize);
bool alloc = size != fSize && (SkAutoMalloc::kAlloc_OnShrink == shrink || size > fSize);
if (NULL != didChangeAlloc) {
*didChangeAlloc = alloc;
}