Index: src/core/SkChunkAlloc.cpp |
diff --git a/src/core/SkChunkAlloc.cpp b/src/core/SkChunkAlloc.cpp |
index 30cc4e19a7c363f2ba67f47290b5b2fc46cbf9af..8251eae6621151f7cae1de0653b1aab68a1f059f 100644 |
--- a/src/core/SkChunkAlloc.cpp |
+++ b/src/core/SkChunkAlloc.cpp |
@@ -52,6 +52,7 @@ SkChunkAlloc::SkChunkAlloc(size_t minSize) { |
fMinSize = minSize; |
fChunkSize = fMinSize; |
fTotalCapacity = 0; |
+ fTotalUsed = 0; |
fBlockCount = 0; |
} |
@@ -64,6 +65,7 @@ void SkChunkAlloc::reset() { |
fBlock = NULL; |
fChunkSize = fMinSize; // reset to our initial minSize |
fTotalCapacity = 0; |
+ fTotalUsed = 0; |
fBlockCount = 0; |
} |
@@ -90,6 +92,8 @@ SkChunkAlloc::Block* SkChunkAlloc::newBlock(size_t bytes, AllocFailType ftype) { |
} |
void* SkChunkAlloc::alloc(size_t bytes, AllocFailType ftype) { |
+ fTotalUsed += bytes; |
+ |
bytes = SkAlign4(bytes); |
Block* block = fBlock; |