aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-22 20:18:07 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-22 20:18:07 +0000
commitc8fb9983880e53ee5fee65f04e1f29cf95fdd3b3 (patch)
tree3979a52db818bd3e3d135d309d15629c7819bd29
parent572a86584602bcd9709d60f3c857750c4018c3d1 (diff)
Revert r11423 (low hanging calloc fruit)
git-svn-id: http://skia.googlecode.com/svn/trunk@11427 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--src/core/SkBitmap.cpp3
-rw-r--r--src/core/SkTDynamicHash.h4
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<T*>(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) {