OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #include <memory> | 7 #include <memory> |
8 #include "Benchmark.h" | 8 #include "Benchmark.h" |
9 #include "SkRefCnt.h" | 9 #include "SkRefCnt.h" |
10 #include "SkThread.h" | 10 #include "SkThread.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 } | 82 } |
83 } | 83 } |
84 } | 84 } |
85 | 85 |
86 private: | 86 private: |
87 typedef Benchmark INHERITED; | 87 typedef Benchmark INHERITED; |
88 }; | 88 }; |
89 | 89 |
90 class PlacedRefCnt : public SkRefCnt { | 90 class PlacedRefCnt : public SkRefCnt { |
91 public: | 91 public: |
92 SK_DECLARE_INST_COUNT(PlacedRefCnt) | |
93 | |
94 PlacedRefCnt() : SkRefCnt() { } | 92 PlacedRefCnt() : SkRefCnt() { } |
95 void operator delete(void*) { } | 93 void operator delete(void*) { } |
96 | 94 |
97 private: | 95 private: |
98 typedef SkRefCnt INHERITED; | 96 typedef SkRefCnt INHERITED; |
99 }; | 97 }; |
100 | 98 |
101 class RefCntBench_Heap : public Benchmark { | 99 class RefCntBench_Heap : public Benchmark { |
102 public: | 100 public: |
103 bool isSuitableFor(Backend backend) override { | 101 bool isSuitableFor(Backend backend) override { |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 DEF_BENCH( return new AtomicInc32(); ) | 240 DEF_BENCH( return new AtomicInc32(); ) |
243 DEF_BENCH( return new AtomicInc64(); ) | 241 DEF_BENCH( return new AtomicInc64(); ) |
244 | 242 |
245 DEF_BENCH( return new RefCntBench_Stack(); ) | 243 DEF_BENCH( return new RefCntBench_Stack(); ) |
246 DEF_BENCH( return new RefCntBench_Heap(); ) | 244 DEF_BENCH( return new RefCntBench_Heap(); ) |
247 DEF_BENCH( return new RefCntBench_New(); ) | 245 DEF_BENCH( return new RefCntBench_New(); ) |
248 | 246 |
249 DEF_BENCH( return new WeakRefCntBench_Stack(); ) | 247 DEF_BENCH( return new WeakRefCntBench_Stack(); ) |
250 DEF_BENCH( return new WeakRefCntBench_Heap(); ) | 248 DEF_BENCH( return new WeakRefCntBench_Heap(); ) |
251 DEF_BENCH( return new WeakRefCntBench_New(); ) | 249 DEF_BENCH( return new WeakRefCntBench_New(); ) |
OLD | NEW |