Lines Matching refs:space

25 namespace space {
65 std::unique_ptr<Space> space(CreateSpace("test", 16 * MB, 32 * MB, 32 * MB, nullptr));
66 EXPECT_TRUE(space != nullptr);
68 space.reset(CreateSpace("test", 16 * MB, 16 * MB, 16 * MB, nullptr));
69 EXPECT_TRUE(space != nullptr);
71 space.reset(CreateSpace("test", 32 * MB, 16 * MB, 16 * MB, nullptr));
72 EXPECT_TRUE(space == nullptr);
74 space.reset(CreateSpace("test", 16 * MB, 16 * MB, 32 * MB, nullptr));
75 EXPECT_TRUE(space != nullptr);
77 space.reset(CreateSpace("test", 16 * MB, 8 * MB, 32 * MB, nullptr));
78 EXPECT_TRUE(space == nullptr);
80 space.reset(CreateSpace("test", 8 * MB, 16 * MB, 32 * MB, nullptr));
81 EXPECT_TRUE(space != nullptr);
83 space.reset(CreateSpace("test", 8 * MB, 32 * MB, 16 * MB, nullptr));
84 EXPECT_TRUE(space == nullptr);
94 MallocSpace* space(CreateSpace("test", 4 * MB, 16 * MB, 16 * MB, nullptr));
95 ASSERT_TRUE(space != nullptr);
97 // Make space findable to the heap, will also delete space when runtime is cleaned up
98 AddSpace(space);
105 MutableHandle<mirror::Object> ptr1(hs.NewHandle(Alloc(space,
118 mirror::Object* ptr2 = Alloc(space, self, 8 * MB, &dummy, nullptr, &dummy);
123 MutableHandle<mirror::Object> ptr3(hs.NewHandle(AllocWithGrowth(space,
136 mirror::Object* ptr4 = space->Alloc(self, 8 * MB, &dummy, nullptr, &dummy);
140 mirror::Object* ptr5 = space->AllocWithGrowth(self, 8 * MB, &dummy, nullptr, &dummy);
144 size_t free3 = space->AllocationSize(ptr3.Get(), nullptr);
146 EXPECT_EQ(free3, space->Free(self, ptr3.Assign(nullptr)));
151 Handle<mirror::Object> ptr6(hs.NewHandle(AllocWithGrowth(space,
164 size_t free1 = space->AllocationSize(ptr1.Get(), nullptr);
165 space->Free(self, ptr1.Assign(nullptr));
168 // Make sure that the zygote space isn't directly at the start of the space.
169 EXPECT_TRUE(space->Alloc(self, 1U * MB, &dummy, nullptr, &dummy) != nullptr);
172 space::Space* old_space = space;
175 ScopedSuspendAll ssa("Add image space");
179 space::ZygoteSpace* zygote_space = space->CreateZygoteSpace("alloc space",
181 &space);
183 // Add the zygote space.
186 // Make space findable to the heap, will also delete space when runtime is cleaned up
187 AddSpace(space, false);
190 ptr1.Assign(Alloc(space,
203 ptr2 = Alloc(space, self, 8 * MB, &dummy, nullptr, &dummy);
207 ptr3.Assign(AllocWithGrowth(space,
218 space->Free(self, ptr3.Assign(nullptr));
221 free1 = space->AllocationSize(ptr1.Get(), nullptr);
222 space->Free(self, ptr1.Assign(nullptr));
228 MallocSpace* space(CreateSpace("test", 4 * MB, 16 * MB, 16 * MB, nullptr));
229 ASSERT_TRUE(space != nullptr);
233 // Make space findable to the heap, will also delete space when runtime is cleaned up
234 AddSpace(space);
239 MutableHandle<mirror::Object> ptr1(hs.NewHandle(Alloc(space,
252 mirror::Object* ptr2 = Alloc(space, self, 8 * MB, &dummy, nullptr, &dummy);
257 MutableHandle<mirror::Object> ptr3(hs.NewHandle(AllocWithGrowth(space,
270 mirror::Object* ptr4 = Alloc(space, self, 8 * MB, &dummy, nullptr, &dummy);
274 mirror::Object* ptr5 = AllocWithGrowth(space, self, 8 * MB, &dummy, nullptr, &dummy);
278 size_t free3 = space->AllocationSize(ptr3.Get(), nullptr);
280 space->Free(self, ptr3.Assign(nullptr));
285 Handle<mirror::Object> ptr6(hs.NewHandle(AllocWithGrowth(space,
298 size_t free1 = space->AllocationSize(ptr1.Get(), nullptr);
299 space->Free(self, ptr1.Assign(nullptr));
304 MallocSpace* space(CreateSpace("test", 4 * MB, 16 * MB, 16 * MB, nullptr));
305 ASSERT_TRUE(space != nullptr);
307 // Make space findable to the heap, will also delete space when runtime is cleaned up
308 AddSpace(space);
317 lots_of_objects[i] = Alloc(space,
325 EXPECT_EQ(allocation_size, space->AllocationSize(lots_of_objects[i], &computed_usable_size));
332 space->FreeList(self, arraysize(lots_of_objects), lots_of_objects);
337 lots_of_objects[i] = AllocWithGrowth(space,
345 EXPECT_EQ(allocation_size, space->AllocationSize(lots_of_objects[i], &computed_usable_size));
352 space->FreeList(self, arraysize(lots_of_objects), lots_of_objects);
362 } // namespace space