diff options
author | Robert Phillips <robertphillips@google.com> | 2018-06-07 11:14:39 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-07 16:08:41 +0000 |
commit | 9519d4f05a211c2d4a52ad1dacfe59ceeb884adb (patch) | |
tree | 653df89fcbabe994e506a015622ca4f5c7a2158f /tests/GrMemoryPoolTest.cpp | |
parent | 0e6cd9ec988193e51f89f9f5477db7475b0b3838 (diff) |
Remove unused GrObjectMemoryPool
Change-Id: I8d37dfa3a5f0af4741eb6f1c10e13065d20b0ccb
Reviewed-on: https://skia-review.googlesource.com/132829
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/GrMemoryPoolTest.cpp')
-rw-r--r-- | tests/GrMemoryPoolTest.cpp | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/tests/GrMemoryPoolTest.cpp b/tests/GrMemoryPoolTest.cpp index 3df4078db2..bdc5557510 100644 --- a/tests/GrMemoryPoolTest.cpp +++ b/tests/GrMemoryPoolTest.cpp @@ -318,80 +318,3 @@ DEF_TEST(GrMemoryPoolAPI, reporter) { REPORTER_ASSERT(reporter, pool.size() == hugeBlockSize + kMinAllocSize); } } - -DEF_TEST(GrObjectMemoryPoolAPI, reporter) { - struct Data { - int value[5]; - }; - using DataObjectPool = GrObjectMemoryPool<Data>; - constexpr size_t kSmallestMinAllocCount = DataObjectPool::kSmallestMinAllocCount; - - // Allocates objects until pool adds a new block (pool.size() changes). - // Returns number of objects that fit into the current block (i.e. before pool.size() - // changed; newly allocated block always ends up with one object allocated from it). - auto allocateObjects = [](DataObjectPool& pool, AutoPoolReleaser& r) -> size_t { - size_t count = 0; - size_t origPoolSize = pool.size(); - while (pool.size() == origPoolSize) { - r.add(pool.allocate()); - count++; - } - return count - 1; - }; - - // Effective prealloc space capacity is >= kSmallestMinAllocCount. - { - DataObjectPool pool(kSmallestMinAllocCount / 3, 0); - AutoPoolReleaser r(pool); - - size_t preallocCount = allocateObjects(pool, r); - REPORTER_ASSERT(reporter, preallocCount == kSmallestMinAllocCount); - } - - // Effective prealloc space capacity is >= minAllocCount. - { - DataObjectPool pool(kSmallestMinAllocCount, 2 * kSmallestMinAllocCount); - AutoPoolReleaser r(pool); - - size_t preallocCount = allocateObjects(pool, r); - REPORTER_ASSERT(reporter, preallocCount == 2 * kSmallestMinAllocCount); - } - - // Effective block capacity is >= kSmallestMinAllocCount. - { - DataObjectPool pool(kSmallestMinAllocCount, kSmallestMinAllocCount / 2); - AutoPoolReleaser r(pool); - - // Fill prealloc space - allocateObjects(pool, r); - - size_t minAllocCount = 1 + allocateObjects(pool, r); - REPORTER_ASSERT(reporter, minAllocCount == kSmallestMinAllocCount); - } - - // Pool allocates space for exactly preallocCount objects on creation. - { - constexpr size_t kPreallocCount = kSmallestMinAllocCount * 7 / 3; - DataObjectPool pool(kPreallocCount, 0); - AutoPoolReleaser r(pool); - - size_t preallocCount = allocateObjects(pool, r); - REPORTER_ASSERT(reporter, preallocCount == kPreallocCount); - } - - // Pool allocates space for minAllocCount objects when it adds a new block. - { - constexpr size_t kMinAllocCount = kSmallestMinAllocCount * 11 / 3; - DataObjectPool pool(0, kMinAllocCount); - AutoPoolReleaser r(pool); - - // Fill prealloc space - allocateObjects(pool, r); - - size_t firstBlockCount = 1 + allocateObjects(pool, r); - REPORTER_ASSERT(reporter, firstBlockCount == kMinAllocCount); - - size_t secondBlockCount = 1 + allocateObjects(pool, r); - REPORTER_ASSERT(reporter, secondBlockCount == kMinAllocCount); - } -} |