Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: src/core/SkFlate.cpp

Issue 963853002: Flate: skia_alloc_func works on both miniz and zlib (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkFlate.cpp
diff --git a/src/core/SkFlate.cpp b/src/core/SkFlate.cpp
index f990dc3f97095beebda1b0f8c8e0bdbff16821ae..27c76c2e82787f5c418674302ef8679de970f1b7 100644
--- a/src/core/SkFlate.cpp
+++ b/src/core/SkFlate.cpp
@@ -24,8 +24,8 @@ namespace {
// static
const size_t kBufferSize = 1024;
-static void* skia_alloc_func(void*, size_t items, size_t size) {
- return sk_calloc_throw(items * size);
+template <typename T> void* skia_alloc_func(void*, T items, T size) {
mtklein 2015/02/27 19:36:16 Shall we add // Different zlib implementations use
hal.canary 2015/02/27 19:40:40 Done.
+ return sk_calloc_throw(SkToSizeT(items) * SkToSizeT(size));
}
static void skia_free_func(void*, void* address) { sk_free(address); }
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698