combine glyph and image bulk alloc, and adjust initial alloc size, to reduce total waste from 50% to 30%
add diagnostics to measure cache efficiency
BUG=
Review URL: https://codereview.chromium.org/17449012
git-svn-id: http://skia.googlecode.com/svn/trunk@9691 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/MemsetTest.cpp b/tests/MemsetTest.cpp
index c799159..9da7850 100644
--- a/tests/MemsetTest.cpp
+++ b/tests/MemsetTest.cpp
@@ -14,22 +14,27 @@
SkChunkAlloc alloc(min);
REPORTER_ASSERT(reporter, 0 == alloc.totalCapacity());
+ REPORTER_ASSERT(reporter, 0 == alloc.totalUsed());
REPORTER_ASSERT(reporter, 0 == alloc.blockCount());
REPORTER_ASSERT(reporter, !alloc.contains(NULL));
REPORTER_ASSERT(reporter, !alloc.contains(reporter));
alloc.reset();
REPORTER_ASSERT(reporter, 0 == alloc.totalCapacity());
+ REPORTER_ASSERT(reporter, 0 == alloc.totalUsed());
REPORTER_ASSERT(reporter, 0 == alloc.blockCount());
size_t size = min >> 1;
void* ptr = alloc.allocThrow(size);
REPORTER_ASSERT(reporter, alloc.totalCapacity() >= size);
+ REPORTER_ASSERT(reporter, alloc.totalUsed() == size);
REPORTER_ASSERT(reporter, alloc.blockCount() > 0);
REPORTER_ASSERT(reporter, alloc.contains(ptr));
alloc.reset();
REPORTER_ASSERT(reporter, !alloc.contains(ptr));
+ REPORTER_ASSERT(reporter, 0 == alloc.totalCapacity());
+ REPORTER_ASSERT(reporter, 0 == alloc.totalUsed());
}
///////////////////////////////////////////////////////////////////////////////