From c8fb9983880e53ee5fee65f04e1f29cf95fdd3b3 Mon Sep 17 00:00:00 2001 From: "robertphillips@google.com" Date: Sun, 22 Sep 2013 20:18:07 +0000 Subject: Revert r11423 (low hanging calloc fruit) git-svn-id: http://skia.googlecode.com/svn/trunk@11427 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/core/SkBitmap.cpp | 3 ++- src/core/SkTDynamicHash.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp index dcc7b2e303..d3bbecd706 100644 --- a/src/core/SkBitmap.cpp +++ b/src/core/SkBitmap.cpp @@ -1632,7 +1632,8 @@ void SkBitmap::unflatten(SkFlattenableReadBuffer& buffer) { SkBitmap::RLEPixels::RLEPixels(int width, int height) { fHeight = height; - fYPtrs = (uint8_t**)sk_calloc_throw(height * sizeof(uint8_t*)); + fYPtrs = (uint8_t**)sk_malloc_throw(height * sizeof(uint8_t*)); + sk_bzero(fYPtrs, height * sizeof(uint8_t*)); } SkBitmap::RLEPixels::~RLEPixels() { diff --git a/src/core/SkTDynamicHash.h b/src/core/SkTDynamicHash.h index 4cb44204c8..47412c34b1 100644 --- a/src/core/SkTDynamicHash.h +++ b/src/core/SkTDynamicHash.h @@ -92,7 +92,9 @@ private: static T* Deleted() { return reinterpret_cast(1); } // Also an invalid pointer. static T** AllocArray(int capacity) { - return (T**)sk_calloc_throw(sizeof(T*) * capacity); // All cells == Empty(). + T** array = (T**)sk_malloc_throw(sizeof(T*) * capacity); + sk_bzero(array, sizeof(T*) * capacity); // All cells == Empty(). + return array; } void reset(int capacity) { -- cgit v1.2.3