aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-20 19:59:47 +0000
committerGravatar mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-20 19:59:47 +0000
commit2905ff552c75344309e858c4259e7489d3ab586d (patch)
tree5a7e32350b630cf2fe9fd4ec96e726e672445686 /src/core
parent94248f85e5eca62fa97310d9f80297fa0ceaa6d4 (diff)
low hanging calloc fruit
BUG= R=reed@google.com Review URL: https://codereview.chromium.org/24267014 git-svn-id: http://skia.googlecode.com/svn/trunk@11423 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkBitmap.cpp3
-rw-r--r--src/core/SkTDynamicHash.h4
2 files changed, 2 insertions, 5 deletions
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index d3bbecd706..dcc7b2e303 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -1632,8 +1632,7 @@ void SkBitmap::unflatten(SkFlattenableReadBuffer& buffer) {
SkBitmap::RLEPixels::RLEPixels(int width, int height) {
fHeight = height;
- fYPtrs = (uint8_t**)sk_malloc_throw(height * sizeof(uint8_t*));
- sk_bzero(fYPtrs, height * sizeof(uint8_t*));
+ fYPtrs = (uint8_t**)sk_calloc_throw(height * sizeof(uint8_t*));
}
SkBitmap::RLEPixels::~RLEPixels() {
diff --git a/src/core/SkTDynamicHash.h b/src/core/SkTDynamicHash.h
index 47412c34b1..4cb44204c8 100644
--- a/src/core/SkTDynamicHash.h
+++ b/src/core/SkTDynamicHash.h
@@ -92,9 +92,7 @@ private:
static T* Deleted() { return reinterpret_cast<T*>(1); } // Also an invalid pointer.
static T** AllocArray(int capacity) {
- T** array = (T**)sk_malloc_throw(sizeof(T*) * capacity);
- sk_bzero(array, sizeof(T*) * capacity); // All cells == Empty().
- return array;
+ return (T**)sk_calloc_throw(sizeof(T*) * capacity); // All cells == Empty().
}
void reset(int capacity) {