Lines Matching defs:Allocate

19   int *a = (int*)Alloc.Allocate(sizeof(int), alignof(int));
20 int *b = (int*)Alloc.Allocate(sizeof(int) * 10, alignof(int));
21 int *c = (int*)Alloc.Allocate(sizeof(int), alignof(int));
48 // Allocate enough bytes to create three slabs.
51 Alloc.Allocate(3000, 1);
53 Alloc.Allocate(3000, 1);
55 Alloc.Allocate(3000, 1);
59 // Allocate enough bytes to create two slabs, reset the allocator, and do it
64 // Allocate something larger than the SizeThreshold=4096.
65 (void)Alloc.Allocate(5000, 1);
70 Alloc.Allocate(3000, 1);
72 Alloc.Allocate(3000, 1);
76 Alloc.Allocate(3000, 1);
78 Alloc.Allocate(3000, 1);
86 a = (uintptr_t)Alloc.Allocate(1, 2);
88 a = (uintptr_t)Alloc.Allocate(1, 4);
90 a = (uintptr_t)Alloc.Allocate(1, 8);
92 a = (uintptr_t)Alloc.Allocate(1, 16);
94 a = (uintptr_t)Alloc.Allocate(1, 32);
96 a = (uintptr_t)Alloc.Allocate(1, 64);
98 a = (uintptr_t)Alloc.Allocate(1, 128);
104 // However Allocate never returns null, so if the first allocation is zero-sized
112 void *Empty = Alloc.Allocate(0, 1);
113 EXPECT_NE(Empty, nullptr) << "Allocate is __attribute__((returns_nonnull))";
117 void *Large = Alloc.Allocate(4096, 1);
122 void *Empty2 = Alloc.Allocate(0, 1);
134 Alloc.Allocate(4096, 1);
138 Alloc.Allocate(1, 1);
146 Alloc.Allocate(8000, 1);
153 Alloc.Allocate(4095, 1);
158 Alloc.Allocate(1024, 8192);
173 Alloc.Allocate(SlabSize, 1);
177 Alloc.Allocate(SlabSize, 1);
179 Alloc.Allocate(SlabSize, 1);
186 Alloc.Allocate(SlabSize, 1);
200 // Allocate 256 slabs. We should keep getting slabs with the original size
203 Alloc.Allocate(SlabSize, 1);
205 // Allocate another slab. This time we should get another slab allocated
207 Alloc.Allocate(SlabSize, 1);
214 uint64_t *a = (uint64_t *)Alloc.Allocate(sizeof(uint64_t), alignof(uint64_t));
226 (uint64_t *)Alloc.Allocate(sizeof(uint64_t) * 1024, alignof(uint64_t));
240 void *Allocate(size_t Size, size_t /*Alignment*/) {
241 // Allocate space for the alignment, the slab, and a void* that goes right
265 // Allocate a large-ish block with a really large alignment so that the
272 (void)Alloc.Allocate(1, 1);
275 (void)Alloc.Allocate(3000, 2048);