Lines Matching defs:cache
224 typename Allocator::AllocatorCache cache;
225 memset(&cache, 0, sizeof(cache));
226 cache.Init(0);
246 char *x = (char*)cache.Allocate(a, class_id0);
270 cache.Deallocate(a, a->GetSizeClass(x), x);
373 typename Allocator::AllocatorCache cache;
374 memset(&cache, 0, sizeof(cache));
375 cache.Init(0);
381 void *x = cache.Allocate(a, 1 + i % (Allocator::kNumClasses - 1));
392 cache.Deallocate(a, 1 + i % (Allocator::kNumClasses - 1), allocated[i]);
433 typename Allocator::AllocatorCache cache;
434 memset(&cache, 0, sizeof(cache));
435 cache.Init(0);
441 void *x = cache.Allocate(a, max_size_class);
522 typename Allocator64WithCallBack::AllocatorCache cache;
523 memset(&cache, 0, sizeof(cache));
524 cache.Init(0);
559 Allocator32WithCallBack::AllocatorCache cache;
560 memset(&cache, 0, sizeof(cache));
561 cache.Init(0);
564 a->AllocateBatch(&stats, &cache, 32);
591 Allocator64::AllocatorCache cache;
592 memset(&cache, 0, sizeof(cache));
593 cache.Init(0);
698 typename Allocator::AllocatorCache cache;
699 memset(&cache, 0, sizeof(cache));
700 a->InitCache(&cache);
702 EXPECT_EQ(a->Allocate(&cache, -1, 1), (void*)0);
703 EXPECT_EQ(a->Allocate(&cache, -1, 1024), (void*)0);
704 EXPECT_EQ(a->Allocate(&cache, (uptr)-1 - 1024, 1), (void*)0);
705 EXPECT_EQ(a->Allocate(&cache, (uptr)-1 - 1024, 1024), (void*)0);
706 EXPECT_EQ(a->Allocate(&cache, (uptr)-1 - 1023, 1024), (void*)0);
707 EXPECT_EQ(a->Allocate(&cache, -1, 1), (void*)0);
717 void *x = a->Allocate(&cache, size, 1);
748 a->Deallocate(&cache, x);
751 a->SwallowCache(&cache);
753 a->DestroyCache(&cache);
792 AllocatorCache cache;
796 memset(&cache, 0, sizeof(cache));
797 cache.Init(0);
806 allocated[i] = cache.Allocate(a, class_id);
809 cache.Deallocate(a, class_id, allocated[i]);
811 cache.Drain(a);
899 // The allocator cache is supposed to be POD and zero initialized. We should be
900 // able to call Deallocate on a zeroed cache, and it will self-initialize.
975 typename Allocator::AllocatorCache cache;
976 memset(&cache, 0, sizeof(cache));
977 cache.Init(0);
993 void *x = cache.Allocate(a, class_id0);
1124 SpecialAllocator64::AllocatorCache cache;
1125 memset(&cache, 0, sizeof(cache));
1126 cache.Init(0);
1135 EXPECT_NE(cache.Allocate(a, kClassID), nullptr);
1136 EXPECT_NE(cache.Allocate(a, kClassID), nullptr);
1137 EXPECT_EQ(cache.Allocate(a, kClassID), nullptr);
1144 p[i] = (char*)cache.Allocate(a, Class2);
1150 EXPECT_EQ(cache.Allocate(a, Class2), nullptr);
1151 cache.Deallocate(a, Class2, p[0]);
1152 cache.Drain(a);