aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-06-19 19:25:36 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-06-19 19:25:36 +0000
commit6757a3c71fd6c16af6bbd76f268307f0177b17ae (patch)
tree0031572fda6b00a7ab8b91ad3c0079cede2103bd /tests
parent3832da1e9cf6066d22007881888d65405d8cc6a5 (diff)
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
Diffstat (limited to 'tests')
-rw-r--r--tests/MemsetTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/MemsetTest.cpp b/tests/MemsetTest.cpp
index c79915989d..9da7850cc3 100644
--- a/tests/MemsetTest.cpp
+++ b/tests/MemsetTest.cpp
@@ -14,22 +14,27 @@ static void test_chunkalloc(skiatest::Reporter* reporter) {
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());
}
///////////////////////////////////////////////////////////////////////////////