| /arkcompiler/runtime_core/runtime/tests/ |
| D | frame_allocator_test.cpp | 48 FrameAllocator<> alloc(use_malloc); in SmallAllocateTest() local 51 array[i] = alloc.Alloc(FRAME_SIZE); in SmallAllocateTest() 57 alloc.Free(array[i]); in SmallAllocateTest() 70 void *mem = alloc1.Alloc(FIRST_FRAME_SIZE); in CornerAllocationSizeTest() 74 mem = alloc1.Alloc(SECOND_FRAME_SIZE); in CornerAllocationSizeTest() 78 void *mem = alloc2.Alloc(SECOND_FRAME_SIZE); in CornerAllocationSizeTest() 82 mem = alloc2.Alloc(THIRD_FRAME_SIZE); in CornerAllocationSizeTest() 86 void *mem = alloc3.Alloc(THIRD_FRAME_SIZE); in CornerAllocationSizeTest() 90 mem = alloc3.Alloc(THIRD_FRAME_SIZE); in CornerAllocationSizeTest() 93 ASSERT_NE(alloc1.Alloc(FIRST_FRAME_SIZE), nullptr); in CornerAllocationSizeTest() [all …]
|
| D | runslots_allocator_test.cpp | 49 void AddMemoryPoolToAllocator(NonObjectAllocator &alloc) override in AddMemoryPoolToAllocator() argument 55 if (!alloc.AddMemoryPool(mem, DEFAULT_POOL_SIZE_FOR_ALLOC)) { in AddMemoryPoolToAllocator() 60 void AddMemoryPoolToAllocatorProtected(NonObjectAllocator &alloc) override in AddMemoryPoolToAllocatorProtected() argument 68 if (!alloc.AddMemoryPool(mem, DEFAULT_POOL_SIZE_FOR_ALLOC)) { in AddMemoryPoolToAllocatorProtected() 73 void ReleasePages(NonObjectAllocator &alloc) in ReleasePages() argument 75 alloc.ReleaseEmptyRunSlotsPagesUnsafe(); in ReleasePages() 85 LOG(DEBUG, ALLOC) << "Test RunSlots with size " << slots_size; in TestRunSlots() 94 LOG(DEBUG, ALLOC) << "Iteration = " << i; in TestRunSlots() 112 LOG(DEBUG, ALLOC) << "SimpleAllocateDifferentObjSizeTest"; in TEST_F() 117 void *mem = allocator.Alloc(i); in TEST_F() [all …]
|
| D | freelist_allocator_test.cpp | 67 void AddMemoryPoolToAllocator(NonObjectFreeListAllocator &alloc) override in AddMemoryPoolToAllocator() argument 71 … AllocatorType::FREELIST_ALLOCATOR, &alloc); in AddMemoryPoolToAllocator() 77 if (!alloc.AddMemoryPool(pool.GetMem(), pool.GetSize())) { in AddMemoryPoolToAllocator() 82 void AddMemoryPoolToAllocatorProtected(NonObjectFreeListAllocator &alloc) override in AddMemoryPoolToAllocatorProtected() argument 85 AddMemoryPoolToAllocator(alloc); in AddMemoryPoolToAllocatorProtected() 114 LOG(DEBUG, ALLOC) << "SimpleAllocateDifferentObjSizeTest"; in TEST_F() 119 void *mem = allocator.Alloc(i); in TEST_F() 120 LOG(DEBUG, ALLOC) << "Allocate obj with size " << i << " at " << std::hex << mem; in TEST_F() 197 void *mem = allocator.Alloc(min_alloc_size); in TEST_F() 213 void *mem = allocator.Alloc(min_alloc_size * 2); in TEST_F() [all …]
|
| D | humongous_obj_allocator_test.cpp | 56 void AddMemoryPoolToAllocator(NonObjectHumongousObjAllocator &alloc) override in AddMemoryPoolToAllocator() argument 58 AddMemoryPoolToAllocator(alloc, DEFAULT_POOL_SIZE_FOR_ALLOC); in AddMemoryPoolToAllocator() 61 void AddMemoryPoolToAllocator(NonObjectHumongousObjAllocator &alloc, size_t size) in AddMemoryPoolToAllocator() argument 67 … AllocatorType::HUMONGOUS_ALLOCATOR, &alloc); in AddMemoryPoolToAllocator() 73 if (!alloc.AddMemoryPool(pool.GetMem(), size)) { in AddMemoryPoolToAllocator() 78 void AddMemoryPoolToAllocatorProtected(NonObjectHumongousObjAllocator &alloc) override in AddMemoryPoolToAllocatorProtected() argument 81 AddMemoryPoolToAllocator(alloc); in AddMemoryPoolToAllocatorProtected() 113 void *first_object = allocator.Alloc(FIRST_OBJECT_SIZE, OBJECT_ALIGNMENT); in TEST_F() 116 void *second_object = allocator.Alloc(SECOND_OBJECT_SIZE, OBJECT_ALIGNMENT); in TEST_F() 122 LOG(DEBUG, ALLOC) << "SimpleAllocateDifferentObjSizeTest"; in TEST_F() [all …]
|
| D | region_allocator_test.cpp | 116 void *mem = allocator.Alloc<alloc_type>(OBJECT_SIZE); in AllocateObjectWithClass() 130 ASSERT_TRUE(allocator.Alloc(size) != nullptr) in AllocateRegularObject() 134 ASSERT_TRUE(allocator.Alloc(size) != nullptr); in AllocateRegularObject() 138 ASSERT_TRUE(allocator.Alloc(align_size) == nullptr); in AllocateRegularObject() 141 ASSERT_TRUE(allocator.Alloc(align_size) != nullptr); in AllocateRegularObject() 154 ASSERT_TRUE(allocator.Alloc(alloc_size) == nullptr); in AllocateLargeObject() 157 ASSERT_TRUE(allocator.Alloc(alloc_size) != nullptr); in AllocateLargeObject() 172 ASSERT_TRUE(allocator.Alloc(allocator.GetMaxRegularObjectSize() / 2 + 1) != nullptr); in TEST_F() 175 ASSERT_TRUE(allocator.Alloc(allocator.GetMaxRegularObjectSize() / 2 + 1) == nullptr); in TEST_F() 190 ASSERT_TRUE(allocator.Alloc(1) == nullptr); in TEST_F() [all …]
|
| D | bump_allocator_test.cpp | 91 arr[i] = static_cast<int *>(bp_allocator.Alloc(sizeof(int), align)); in TEST_F() 107 …EXPECT_DEATH_IF_SUPPORTED(ptr = bp_allocator.Alloc(sizeof(int), LOG_ALIGN_MAX), "alignment == DEFA… in TEST_F() 110 ptr = bp_allocator.Alloc(SIZE_1M); in TEST_F() 111 ASSERT_EQ(ptr, nullptr) << "Here Alloc with allocation size = 1 MB should return nullptr" in TEST_F() 137 common_elements[i] = static_cast<ALLOC_TYPE *>(allocator.Alloc(sizeof(ALLOC_TYPE))); in TEST_F() 148 tlab_elements[i] = static_cast<ALLOC_TYPE *>(tlab->Alloc(sizeof(ALLOC_TYPE))); in TEST_F() 154 ASSERT_TRUE(allocator.Alloc(sizeof(ALLOC_TYPE)) == nullptr); in TEST_F() 155 ASSERT_TRUE(tlab->Alloc(sizeof(ALLOC_TYPE)) == nullptr); in TEST_F() 185 tlab_elements[i] = static_cast<ALLOC_TYPE *>(tlab->Alloc(sizeof(ALLOC_TYPE))); in TEST_F() 193 common_elements[i] = static_cast<ALLOC_TYPE *>(allocator.Alloc(sizeof(ALLOC_TYPE))); in TEST_F() [all …]
|
| D | internal_allocator_test.cpp | 56 mem = allocator_->Alloc(alloc_size); in InfinitiveAllocate() 113 ASSERT(allocator_->Alloc(0) == nullptr); in TEST_F() 119 void *mem = allocator_->Alloc(RunSlots<>::MaxSlotSize()); in TEST_F() 124 mem = allocator_->Alloc(FreeListAllocator<EmptyMemoryConfig>::GetMaxSize()); in TEST_F() 129 mem = allocator_->Alloc(FreeListAllocator<EmptyMemoryConfig>::GetMaxSize() + 1); in TEST_F() 145 auto *ptr = allocator_->Alloc(N); in TEST_F()
|
| D | mem_leak_test.cpp | 42 auto ptr = allocator->Alloc(4); in TEST_F() 56 auto ptr = allocator->Alloc(1_KB); in TEST_F() 70 auto ptr = allocator->Alloc(1_MB); in TEST_F()
|
| D | rem_set_test.cpp | 93 auto obj1 = static_cast<ObjectHeader *>(allocator.Alloc(allocator.GetMaxRegularObjectSize())); in TEST_F() 97 auto obj2 = static_cast<ObjectHeader *>(allocator.Alloc(allocator.GetMaxRegularObjectSize())); in TEST_F() 128 auto obj1 = static_cast<ObjectHeader *>(allocator.Alloc(allocator.GetMaxRegularObjectSize())); in TEST_F() 132 auto obj2 = static_cast<ObjectHeader *>(allocator.Alloc(allocator.GetMaxRegularObjectSize())); in TEST_F() 163 auto obj1 = static_cast<ObjectHeader *>(allocator.Alloc(allocator.GetMaxRegularObjectSize())); in TEST_F() 167 auto obj2 = static_cast<ObjectHeader *>(allocator.Alloc(allocator.GetMaxRegularObjectSize())); in TEST_F()
|
| /arkcompiler/runtime_core/compiler/tests/ |
| D | live_registers_test.cpp | 33 auto alloc = GetGraph()->GetAllocator(); in TEST_F() local 34 auto intervals = ArenaVector<LifeIntervals *>(alloc->Adapter()); in TEST_F() 35 …intervals.push_back(alloc->New<LifeIntervals>(alloc, GetGraph()->CreateInstAdd(), LiveRange(0, 42)… in TEST_F() 41 auto alloc = GetGraph()->GetAllocator(); in TEST_F() local 42 auto intervals = ArenaVector<LifeIntervals *>(alloc->Adapter()); in TEST_F() 43 …intervals.push_back(alloc->New<LifeIntervals>(alloc, GetGraph()->CreateInstAdd(), LiveRange(0, 10)… in TEST_F() 44 …intervals.push_back(alloc->New<LifeIntervals>(alloc, GetGraph()->CreateInstAdd(), LiveRange(0, 2))… in TEST_F() 45 …intervals.push_back(alloc->New<LifeIntervals>(alloc, GetGraph()->CreateInstAdd(), LiveRange(2, 3))… in TEST_F() 46 …intervals.push_back(alloc->New<LifeIntervals>(alloc, GetGraph()->CreateInstAdd(), LiveRange(5, 6))… in TEST_F() 47 …intervals.push_back(alloc->New<LifeIntervals>(alloc, GetGraph()->CreateInstAdd(), LiveRange(6, 8))… in TEST_F() [all …]
|
| /arkcompiler/runtime_core/libpandabase/mem/ |
| D | arena_allocator.cpp | 72 void *mem = arenas_->Alloc(size, alignment); in AllocateAndAddNewPool() 81 LOG(DEBUG, ALLOC) << "Can not add new pool for " << SpaceTypeToString(space_type_); in AllocateAndAddNewPool() 84 mem = arenas_->Alloc(size, alignment); in AllocateAndAddNewPool() 91 void *ArenaAllocatorT<use_oom_handler>::Alloc(size_t size, Alignment align) in Alloc() function in panda::ArenaAllocatorT 94 LOG(DEBUG, ALLOC) << "ArenaAllocator: try to alloc " << size << " with align " << align; in Alloc() 97 LOG(DEBUG, ALLOC) << "\tTry to allocate from stack"; in Alloc() 98 ret = buff_.Alloc(size, align); in Alloc() 99 LOG_IF(ret, DEBUG, ALLOC) << "\tallocate from stack buffer"; in Alloc() 112 LOG(DEBUG, ALLOC) << "ArenaAllocator: allocated " << size << " bytes aligned by " << align; in Alloc() 120 LOG(DEBUG, ALLOC) << "ArenaAllocator: resize to new size " << new_size; in Resize() [all …]
|
| D | arena-inl.h | 37 LOG(DEBUG, ALLOC) << "Arena: created with buff addr = " << buff << " size = " << buff_size; in Arena() 43 LOG(DEBUG, ALLOC) << "Destroy Arena buff addr = " << buff_ << " size = " << size_; in ~Arena() 46 inline void *Arena::Alloc(size_t size, Alignment alignment) in Alloc() function 55 …LOG(DEBUG, ALLOC) << "Arena::Alloc size = " << size << " alignment = " << alignment << " at addr =… in Alloc() 75 LOG(DEBUG, ALLOC) << "Link arena " << this << " to " << arena; in LinkTo() 147 LOG(DEBUG, ALLOC) << "Expand arena: Add " << size << " bytes to the arena " << this; in ExpandArena()
|
| D | alloc_tracker.cpp | 109 AllocInfo *alloc = it->second; in TrackFree() local 114 new (cur_arena_.data()) FreeInfo(alloc->GetId()); in TrackFree() 166 auto alloc = reinterpret_cast<AllocInfo *>(ptr + pos); in Dump() local 167 Write(alloc->GetTag(), out); in Dump() 168 Write(alloc->GetId(), out); in Dump() 169 Write(alloc->GetSize(), out); in Dump() 170 Write(alloc->GetSpace(), out); in Dump() 171 Write(id_map[alloc->GetStacktraceId()], out); in Dump()
|
| D | arena_allocator.h | 73 [[nodiscard]] void *Alloc(size_t size, Alignment align = DEFAULT_ARENA_ALIGNMENT); 78 auto p = reinterpret_cast<void *>(Alloc(sizeof(T))); in New() 92 void *p = Alloc(SIZE_BEFORE_DATA_OFFSET + sizeof(element_type) * size); in New() 131 void *Alloc(size_t size, Alignment align = DEFAULT_ARENA_ALIGNMENT) 166 …void *Alloc([[maybe_unused]] size_t size, [[maybe_unused]] Alignment align = DEFAULT_ARENA_ALIGNME… 241 return static_cast<T *>(Alloc(sizeof(T) * arr_length)); in AllocArray()
|
| /arkcompiler/runtime_core/runtime/mem/ |
| D | pygote_space_allocator-inl.h | 28 #define LOG_PYGOTE_SPACE_ALLOCATOR(level) LOG(level, ALLOC) << "PygoteSpaceAllocator: " 89 inline void *PygoteSpaceAllocator<AllocConfigT>::Alloc(size_t size, Alignment align) in Alloc() function 93 // alloc from runslots firstly, if failed, try to alloc from new arena in Alloc() 96 void *obj = runslots_alloc_.template Alloc<true, false>(size, align); in Alloc() 102 obj = runslots_alloc_.Alloc(size, align); in Alloc() 113 … LOG(FATAL, ALLOC) << "PygoteSpaceAllocator: couldn't add memory pool to object allocator"; in Alloc() 115 // alloc object again in Alloc() 116 obj = runslots_alloc_.Alloc(size, align); in Alloc() 119 obj = arena_->Alloc(size, align); in Alloc() 130 obj = arena_->Alloc(size, align); in Alloc() [all …]
|
| D | internal_allocator.cpp | 23 #define LOG_INTERNAL_ALLOCATOR(level) LOG(level, ALLOC) << "InternalAllocator: " 65 [[nodiscard]] void *InternalAllocator<Config>::Alloc(size_t size, Alignment align) in Alloc() function in panda::mem::InternalAllocator 80 res = malloc_allocator_->Alloc(size, align); in Alloc() 143 void *res = runslots_allocator->Alloc(size, align); in AllocInRunSlots() 149 res = runslots_allocator->Alloc(size, align); in AllocInRunSlots() 193 res = freelist_allocator_->Alloc(size, align); in AllocViaPandaAllocators() 199 res = freelist_allocator_->Alloc(size, align); in AllocViaPandaAllocators() 215 res = humongous_allocator_->Alloc(size, align); in AllocViaPandaAllocators() 221 res = humongous_allocator_->Alloc(size, align); in AllocViaPandaAllocators() 343 template void *InternalAllocator<InternalAllocatorConfig::PANDA_ALLOCATORS>::Alloc<AllocScope::GLOB… [all …]
|
| D | region_allocator-inl.h | 140 … void *mem = GetCurrentRegion<is_atomic, region_type>()->template Alloc<is_atomic>(align_size); in AllocRegular() 146 mem = GetCurrentRegion<is_atomic, region_type>()->template Alloc<is_atomic>(align_size); in AllocRegular() 153 mem = region->template Alloc<false>(align_size); in AllocRegular() 164 mem = region_to->template Alloc<false>(align_size); in AllocRegular() 174 mem = region_to->template Alloc<false>(align_size); in AllocRegular() 186 void *RegionAllocator<AllocConfigT, LockConfigT>::Alloc(size_t size, Alignment align) in Alloc() function 201 mem = region->Alloc<false>(align_size); in Alloc() 230 LOG(DEBUG, ALLOC) << "Use retained tlabs region " << region; in CreateNewTLAB() 256 …LOG(DEBUG, ALLOC) << "Found a region " << region << " and create tlab " << tlab << " with memory s… in CreateNewTLAB() 262 … LOG(DEBUG, ALLOC) << "Add a region " << region << " with remained size " << remaining_size in CreateNewTLAB() [all …]
|
| /arkcompiler/runtime_core/libpandabase/tests/ |
| D | alloc_tracker_test.cpp | 110 AllocInfo alloc; in TEST() local 112 out.read(reinterpret_cast<char *>(&alloc), sizeof(alloc)); in TEST() 115 ASSERT_EQ(DetailAllocTracker::ALLOC_TAG, alloc.tag); in TEST() 116 ASSERT_EQ(0, alloc.id); in TEST() 117 ASSERT_EQ(20, alloc.size); in TEST() 118 ASSERT_EQ(static_cast<uint32_t>(SpaceType::SPACE_TYPE_INTERNAL), alloc.space); in TEST() 119 ASSERT_EQ(0, alloc.stacktrace_id); in TEST()
|
| D | logger_test.cpp | 40 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); 55 EXPECT_TRUE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); 77 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); 158 EXPECT_TRUE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); 175 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); 181 EXPECT_TRUE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); 195 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); 201 EXPECT_TRUE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); 213 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); 223 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::WARNING, Logger::Component::ALLOC)); [all …]
|
| D | arena_test.cpp | 58 ASSERT_TRUE(arena->Alloc(alloc_size) != nullptr); in GetOccupiedAndFreeSizeTestImplementation() 71 void *first_allocation = arena->Alloc(alloc_size); in ResizeAndResetTestImplementation() 72 void *second_allocation = arena->Alloc(alloc_size); in ResizeAndResetTestImplementation() 78 void *third_allocation = arena->Alloc(alloc_size); in ResizeAndResetTestImplementation()
|
| /arkcompiler/runtime_core/runtime/mem/gc/hybrid-gc/ |
| D | hybrid_object_allocator.cpp | 47 mem = object_allocator_->Alloc(aligned_size, align); in Allocate() 62 mem = large_object_allocator_->Alloc(size, align); in AllocateInLargeAllocator() 69 … LOG(FATAL, ALLOC) << "HybridObjectAllocator: couldn't add memory pool to large object allocator"; in AllocateInLargeAllocator() 71 mem = large_object_allocator_->Alloc(size, align); in AllocateInLargeAllocator() 74 mem = humongous_object_allocator_->Alloc(size, align); in AllocateInLargeAllocator() 83 LOG(FATAL, ALLOC) in AllocateInLargeAllocator() 86 mem = humongous_object_allocator_->Alloc(size, align); in AllocateInLargeAllocator()
|
| /arkcompiler/runtime_core/runtime/include/mem/ |
| D | allocator.h | 102 [[nodiscard]] void *Alloc(size_t size, Alignment align = DEFAULT_ALIGNMENT) 172 LOG(FATAL, ALLOC) << "Allocator::IterateOverYoungObjects" << std::endl; in IterateOverYoungObjects() 177 LOG(FATAL, ALLOC) << "Allocator::IterateOverTenuredObjects" << std::endl; in IterateOverTenuredObjects() 185 LOG(FATAL, ALLOC) << "Allocator::IterateRegularSizeObjects"; in IterateRegularSizeObjects() 193 LOG(FATAL, ALLOC) << "Allocator::IterateNonRegularSizeObjects"; in IterateNonRegularSizeObjects() 198 LOG(FATAL, ALLOC) << "Allocator::FreeObjectsMovedToPygoteSpace"; in FreeObjectsMovedToPygoteSpace() 211 void *p = Alloc(sizeof(T), GetAlignment<T>()); in New() 225 void *p = Alloc(SIZE_BEFORE_DATA_OFFSET + sizeof(element_type) * size, GetAlignment<T>()); in New() 437 LOG(FATAL, ALLOC) << "ObjectAllocatorBase shouldn't have Free"; in Free() 459 return allocator_.Alloc(size, align); in Allocate() [all …]
|
| /arkcompiler/ets_runtime/ecmascript/tests/ |
| D | assert_scope_test.cpp | 50 [[maybe_unused]] DisAllowHeapAlloc noHeapAlloc; // set dis-allow alloc in HWTEST_F_L0() 52 [[maybe_unused]] AllowHeapAlloc heapAlloc; // set allow alloc in HWTEST_F_L0() 57 // allow alloc in HWTEST_F_L0()
|
| /arkcompiler/ets_frontend/es2panda/compiler/core/ |
| D | regAllocator.h | 65 auto *ins = Alloc<T>(node, std::forward<Args>(args)...); in Emit() 72 auto *ins = Alloc<T>(node, std::forward<Args>(args)...); in EmitWithType() 79 auto *ins = Alloc<T>(node, std::forward<Args>(args)...); in EmitRange() 129 T *Alloc(const ir::AstNode *node, Args &&... args) in Alloc() function 141 insns.push_back(Alloc<T>(node, std::forward<Args>(args)...)); in Add()
|
| /arkcompiler/runtime_core/compiler/optimizer/optimizations/regalloc/ |
| D | interference_graph.h | 40 … ColorNode(unsigned number, T alloc) : cs_point_set_(alloc), number_(number), physical_(), fixed_() in ColorNode() argument 123 explicit GraphMatrix(ArenaAllocator *alloc) : matrix_(alloc->Adapter()) {} in GraphMatrix() argument 185 explicit InterferenceGraph(ArenaAllocator *alloc) : nodes_(alloc->Adapter()), matrix_(alloc) {} in InterferenceGraph() argument
|