Lines Matching defs:pool
36 // of operations, the size of the objects being allocated, and the size of the pool.
42 // each block of the memory pool).
44 static void run_stack(GrMemoryPool* pool, int loops) {
48 // Push N objects into the pool (or heap if pool is null)
50 objs[j] = pool ? (T*) pool->allocate(sizeof(T)) : new T;
54 if (pool) {
55 pool->release(objs[j]);
68 static void run_queue(GrMemoryPool* pool, int loops) {
72 // Push N objects into the pool (or heap if pool is null)
74 objs[j] = pool ? (T*) pool->allocate(sizeof(T)) : new T;
78 if (pool) {
79 pool->release(objs[j]);
89 // N objects are created and immediately destroyed, so space at the start of the pool should be
92 static void run_pushpop(GrMemoryPool* pool, int loops) {
96 // Push N objects into the pool (or heap if pool is null)
98 if (pool) {
99 objs[j] = (T*) pool->allocate(sizeof(T));
100 pool->release(objs[j]);
113 static void run_random(GrMemoryPool* pool, int loops) {
122 if (pool) {
123 pool->release(objs[j]);
140 objs[k] = pool ? (T*) pool->allocate(sizeof(T)) : new T;
173 std::unique_ptr<GrMemoryPool> pool;
175 pool = GrMemoryPool::Make(fPoolSize, fPoolSize);
178 fProc(pool.get(), loops);