Lines Matching refs:Alloc
19 BumpPtrAllocator Alloc;
20 int *a = (int*)Alloc.Allocate(sizeof(int), 1);
21 int *b = (int*)Alloc.Allocate(sizeof(int) * 10, 1);
22 int *c = (int*)Alloc.Allocate(sizeof(int), 1);
31 EXPECT_EQ(1U, Alloc.GetNumSlabs());
33 BumpPtrAllocator Alloc2 = std::move(Alloc);
34 EXPECT_EQ(0U, Alloc.GetNumSlabs());
44 Alloc = std::move(Alloc2);
46 EXPECT_EQ(1U, Alloc.GetNumSlabs());
51 BumpPtrAllocator Alloc;
52 Alloc.Allocate(3000, 1);
53 EXPECT_EQ(1U, Alloc.GetNumSlabs());
54 Alloc.Allocate(3000, 1);
55 EXPECT_EQ(2U, Alloc.GetNumSlabs());
56 Alloc.Allocate(3000, 1);
57 EXPECT_EQ(3U, Alloc.GetNumSlabs());
63 BumpPtrAllocator Alloc;
66 (void)Alloc.Allocate(5000, 1);
67 Alloc.Reset();
69 EXPECT_EQ(0u, Alloc.GetNumSlabs());
71 Alloc.Allocate(3000, 1);
72 EXPECT_EQ(1U, Alloc.GetNumSlabs());
73 Alloc.Allocate(3000, 1);
74 EXPECT_EQ(2U, Alloc.GetNumSlabs());
75 Alloc.Reset();
76 EXPECT_EQ(1U, Alloc.GetNumSlabs());
77 Alloc.Allocate(3000, 1);
78 EXPECT_EQ(1U, Alloc.GetNumSlabs());
79 Alloc.Allocate(3000, 1);
80 EXPECT_EQ(2U, Alloc.GetNumSlabs());
85 BumpPtrAllocator Alloc;
87 a = (uintptr_t)Alloc.Allocate(1, 2);
89 a = (uintptr_t)Alloc.Allocate(1, 4);
91 a = (uintptr_t)Alloc.Allocate(1, 8);
93 a = (uintptr_t)Alloc.Allocate(1, 16);
95 a = (uintptr_t)Alloc.Allocate(1, 32);
97 a = (uintptr_t)Alloc.Allocate(1, 64);
99 a = (uintptr_t)Alloc.Allocate(1, 128);
106 BumpPtrAllocator Alloc;
109 Alloc.Allocate(4096, 1);
110 EXPECT_EQ(1U, Alloc.GetNumSlabs());
113 Alloc.Allocate(1, 1);
114 EXPECT_EQ(2U, Alloc.GetNumSlabs());
119 BumpPtrAllocator Alloc;
121 Alloc.Allocate(8000, 1);
122 EXPECT_EQ(1U, Alloc.GetNumSlabs());
127 BumpPtrAllocator Alloc;
128 Alloc.Allocate(4095, 1);
133 Alloc.Allocate(1024, 8192);
135 EXPECT_EQ(2U, Alloc.GetNumSlabs());
175 BumpPtrAllocatorImpl<MockSlabAllocator> Alloc;
178 (void)Alloc.Allocate(1, 1);
181 (void)Alloc.Allocate(3000, 2048);