• Home
  • Raw
  • Download

Lines Matching refs:Alloc

18   BumpPtrAllocator Alloc;  in TEST()  local
19 int *a = (int*)Alloc.Allocate(sizeof(int), alignof(int)); in TEST()
20 int *b = (int*)Alloc.Allocate(sizeof(int) * 10, alignof(int)); in TEST()
21 int *c = (int*)Alloc.Allocate(sizeof(int), alignof(int)); in TEST()
30 EXPECT_EQ(1U, Alloc.GetNumSlabs()); in TEST()
32 BumpPtrAllocator Alloc2 = std::move(Alloc); in TEST()
33 EXPECT_EQ(0U, Alloc.GetNumSlabs()); in TEST()
43 Alloc = std::move(Alloc2); in TEST()
45 EXPECT_EQ(1U, Alloc.GetNumSlabs()); in TEST()
50 BumpPtrAllocator Alloc; in TEST() local
51 Alloc.Allocate(3000, 1); in TEST()
52 EXPECT_EQ(1U, Alloc.GetNumSlabs()); in TEST()
53 Alloc.Allocate(3000, 1); in TEST()
54 EXPECT_EQ(2U, Alloc.GetNumSlabs()); in TEST()
55 Alloc.Allocate(3000, 1); in TEST()
56 EXPECT_EQ(3U, Alloc.GetNumSlabs()); in TEST()
62 BumpPtrAllocator Alloc; in TEST() local
65 (void)Alloc.Allocate(5000, 1); in TEST()
66 Alloc.Reset(); in TEST()
68 EXPECT_EQ(0u, Alloc.GetNumSlabs()); in TEST()
70 Alloc.Allocate(3000, 1); in TEST()
71 EXPECT_EQ(1U, Alloc.GetNumSlabs()); in TEST()
72 Alloc.Allocate(3000, 1); in TEST()
73 EXPECT_EQ(2U, Alloc.GetNumSlabs()); in TEST()
74 Alloc.Reset(); in TEST()
75 EXPECT_EQ(1U, Alloc.GetNumSlabs()); in TEST()
76 Alloc.Allocate(3000, 1); in TEST()
77 EXPECT_EQ(1U, Alloc.GetNumSlabs()); in TEST()
78 Alloc.Allocate(3000, 1); in TEST()
79 EXPECT_EQ(2U, Alloc.GetNumSlabs()); in TEST()
84 BumpPtrAllocator Alloc; in TEST() local
86 a = (uintptr_t)Alloc.Allocate(1, 2); in TEST()
88 a = (uintptr_t)Alloc.Allocate(1, 4); in TEST()
90 a = (uintptr_t)Alloc.Allocate(1, 8); in TEST()
92 a = (uintptr_t)Alloc.Allocate(1, 16); in TEST()
94 a = (uintptr_t)Alloc.Allocate(1, 32); in TEST()
96 a = (uintptr_t)Alloc.Allocate(1, 64); in TEST()
98 a = (uintptr_t)Alloc.Allocate(1, 128); in TEST()
105 BumpPtrAllocator Alloc; in TEST() local
108 Alloc.Allocate(4096, 1); in TEST()
109 EXPECT_EQ(1U, Alloc.GetNumSlabs()); in TEST()
112 Alloc.Allocate(1, 1); in TEST()
113 EXPECT_EQ(2U, Alloc.GetNumSlabs()); in TEST()
118 BumpPtrAllocator Alloc; in TEST() local
120 Alloc.Allocate(8000, 1); in TEST()
121 EXPECT_EQ(1U, Alloc.GetNumSlabs()); in TEST()
126 BumpPtrAllocator Alloc; in TEST() local
127 Alloc.Allocate(4095, 1); in TEST()
132 Alloc.Allocate(1024, 8192); in TEST()
134 EXPECT_EQ(2U, Alloc.GetNumSlabs()); in TEST()
142 BumpPtrAllocatorImpl<MallocAllocator, SlabSize, SlabSize, GrowthDelay> Alloc; in TEST() local
145 Alloc.setRedZoneSize(0); in TEST()
147 Alloc.Allocate(SlabSize, 1); in TEST()
148 EXPECT_EQ(SlabSize, Alloc.getTotalMemory()); in TEST()
151 Alloc.Allocate(SlabSize, 1); in TEST()
152 EXPECT_EQ(SlabSize * 3, Alloc.getTotalMemory()); in TEST()
153 Alloc.Allocate(SlabSize, 1); in TEST()
154 EXPECT_EQ(SlabSize * 3, Alloc.getTotalMemory()); in TEST()
160 Alloc.Allocate(SlabSize, 1); in TEST()
161 EXPECT_EQ(SlabSize * 7, Alloc.getTotalMemory()); in TEST()
169 BumpPtrAllocatorImpl<MallocAllocator, SlabSize, SlabSize, GrowthDelay> Alloc; in TEST() local
172 Alloc.setRedZoneSize(0); in TEST()
177 Alloc.Allocate(SlabSize, 1); in TEST()
178 EXPECT_EQ(SlabSize * GrowthDelay, Alloc.getTotalMemory()); in TEST()
181 Alloc.Allocate(SlabSize, 1); in TEST()
182 EXPECT_EQ(SlabSize * GrowthDelay + SlabSize * 2, Alloc.getTotalMemory()); in TEST()
222 BumpPtrAllocatorImpl<MockSlabAllocator> Alloc; in TEST() local
225 (void)Alloc.Allocate(1, 1); in TEST()
228 (void)Alloc.Allocate(3000, 2048); in TEST()