Branch Coverage

t/bench.cc
Criterion Covered Total %
branch 3 240 1.2


line true false branch
7 0 1 virtual ~Base() {}
10 0 0 struct Base1 : virtual Base {
0 0 struct Base1 : virtual Base {
14 0 0 struct Base2 : virtual Base1 {
0 0 struct Base2 : virtual Base1 {
0 0 struct Base2 : virtual Base1 {
18 0 0 struct Der : virtual Base2 {
0 0 struct Der : virtual Base2 {
0 0 struct Der : virtual Base2 {
0 0 struct Der : virtual Base2 {
24 0 0 virtual ~ABC() {}
27 0 0 struct Epta : virtual Der, virtual ABC {
0 0 struct Epta : virtual Der, virtual ABC {
0 0 struct Epta : virtual Der, virtual ABC {
0 0 struct Epta : virtual Der, virtual ABC {
0 0 struct Epta : virtual Der, virtual ABC {
0 0 struct Epta : virtual Der, virtual ABC {
43 0 0 Base* get_suka () { return new Epta(); }
46 0 0 Base* b = get_suka();
48 0 0 BENCHMARK("dyn_cast") {
0 0 BENCHMARK("dyn_cast") {
0 0 BENCHMARK("dyn_cast") {
49 0 0 for (size_t i = 0; i < 1000000000; i++) {
50 0 0 res += (uint64_t)dyn_cast(b);
53 0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
57 0 0 MemoryPool pool(16);
59 0 0 for (size_t i = 0; i < 1000000000; i++) {
60 0 0 auto p = pool.allocate();
65 0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
69 0 0 MemoryPool pool(16);
72 0 0 for (size_t j = 0; j < 1000000; ++j) {
73 0 0 for (size_t i = 0; i < 1000; ++i) {
74 0 0 ptrs[i] = pool.allocate();
77 0 0 for (size_t i = 0; i < 1000; ++i) {
81 0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
86 0 0 for (size_t i = 0; i < 1000000000; i++) {
87 0 0 res += (uint64_t)StaticMemoryPool<16>::instance();
89 0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
94 0 0 for (size_t i = 0; i < 1000000000; i++) {
95 0 0 auto p = StaticMemoryPool<16>::instance()->allocate();
0 0 auto p = StaticMemoryPool<16>::instance()->allocate();
97 0 0 StaticMemoryPool<16>::instance()->deallocate(p);
100 0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
106 0 0 for (size_t j = 0; j < 1000000; ++j) {
107 0 0 for (size_t i = 0; i < 1000; ++i) {
108 0 0 ptrs[i] = StaticMemoryPool<16>::allocate();
111 0 0 for (size_t i = 0; i < 1000; ++i) {
112 0 0 StaticMemoryPool<16>::deallocate(ptrs[i]);
115 0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
120 0 0 for (size_t i = 0; i < 1000000000; i++) {
121 0 0 res += (uint64_t)DynamicMemoryPool::instance();
123 0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
128 0 0 for (size_t i = 0; i < 1000000000; i++) {
129 0 0 auto p = DynamicMemoryPool::instance()->allocate(16);
0 0 auto p = DynamicMemoryPool::instance()->allocate(16);
131 0 0 DynamicMemoryPool::instance()->deallocate(p, 16);
0 0 DynamicMemoryPool::instance()->deallocate(p, 16);
134 0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
139 0 0 for (size_t i = 0; i < 1000000000; i++) {
140 0 0 auto p = new FastAlloc();
142 0 0 delete p;
145 0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
151 0 0 for (size_t j = 0; j < 1000000; ++j) {
152 0 0 for (size_t i = 0; i < 1000; ++i) {
153 0 0 ptrs[i] = new FastAlloc();
156 0 0 for (size_t i = 0; i < 1000; ++i) {
157 0 0 delete ptrs[i];
160 0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
0 0 WARN(res);
161 18 0 }
18 0 }