Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: bench/GrMemoryPoolBench.cpp

Issue 1811723002: free -> reset (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: zarro boogs found Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | dm/DMSrcSink.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 7
8 #include "SkTypes.h" 8 #include "SkTypes.h"
9 9
10 // This tests a Gr class 10 // This tests a Gr class
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 enum { 110 enum {
111 kMaxObjects = 4 * (1 << 10), 111 kMaxObjects = 4 * (1 << 10),
112 }; 112 };
113 SkAutoTDelete<B> objects[kMaxObjects]; 113 SkAutoTDelete<B> objects[kMaxObjects];
114 114
115 for (int i = 0; i < loops; i++) { 115 for (int i = 0; i < loops; i++) {
116 uint32_t idx = r.nextRangeU(0, kMaxObjects-1); 116 uint32_t idx = r.nextRangeU(0, kMaxObjects-1);
117 if (nullptr == objects[idx].get()) { 117 if (nullptr == objects[idx].get()) {
118 objects[idx].reset(new B); 118 objects[idx].reset(new B);
119 } else { 119 } else {
120 objects[idx].free(); 120 objects[idx].reset();
121 } 121 }
122 } 122 }
123 } 123 }
124 124
125 private: 125 private:
126 typedef Benchmark INHERITED; 126 typedef Benchmark INHERITED;
127 }; 127 };
128 128
129 struct C { 129 struct C {
130 int gStuff[10]; 130 int gStuff[10];
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 typedef Benchmark INHERITED; 171 typedef Benchmark INHERITED;
172 }; 172 };
173 173
174 /////////////////////////////////////////////////////////////////////////////// 174 ///////////////////////////////////////////////////////////////////////////////
175 175
176 DEF_BENCH( return new GrMemoryPoolBenchStack(); ) 176 DEF_BENCH( return new GrMemoryPoolBenchStack(); )
177 DEF_BENCH( return new GrMemoryPoolBenchRandom(); ) 177 DEF_BENCH( return new GrMemoryPoolBenchRandom(); )
178 DEF_BENCH( return new GrMemoryPoolBenchQueue(); ) 178 DEF_BENCH( return new GrMemoryPoolBenchQueue(); )
179 179
180 #endif 180 #endif
OLDNEW
« no previous file with comments | « no previous file | dm/DMSrcSink.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698