Home
last modified time | relevance | path

Searched full:alloc (Results 1 – 25 of 244) sorted by relevance

12345678910

/arkcompiler/runtime_core/static_core/runtime/tests/
Dframe_allocator_test.cpp53 FrameAllocator<> alloc(useMalloc); in SmallAllocateTest() local
56 array[i] = alloc.Alloc(FRAME_SIZE); in SmallAllocateTest()
62 alloc.Free(array[i]); in SmallAllocateTest()
75 void *mem = alloc1.Alloc(FIRST_FRAME_SIZE); in CornerAllocationSizeTest()
79 mem = alloc1.Alloc(SECOND_FRAME_SIZE); in CornerAllocationSizeTest()
83 void *mem = alloc2.Alloc(SECOND_FRAME_SIZE); in CornerAllocationSizeTest()
87 mem = alloc2.Alloc(THIRD_FRAME_SIZE); in CornerAllocationSizeTest()
91 void *mem = alloc3.Alloc(THIRD_FRAME_SIZE); in CornerAllocationSizeTest()
95 mem = alloc3.Alloc(THIRD_FRAME_SIZE); in CornerAllocationSizeTest()
98 ASSERT_NE(alloc1.Alloc(FIRST_FRAME_SIZE), nullptr); in CornerAllocationSizeTest()
[all …]
Dstack_like_allocator_test.cpp90 StackLikeAllocator<> alloc; in TEST_F() local
93 array[i] = alloc.Alloc(FRAME_SIZE); in TEST_F()
99 alloc.Free(array[i]); in TEST_F()
104 void AlignmentTest(StackLikeAllocator<ALIGNMENT> &alloc) in AlignmentTest() argument
109 array[i] = alloc.Alloc(i * GetAlignmentInBytes(ALIGNMENT)); in AlignmentTest()
122 alloc.Free(array[i]); in AlignmentTest()
128 StackLikeAllocator<> alloc; in TEST_F() local
129 AlignmentTest(alloc); in TEST_F()
153 StackLikeAllocator<> alloc; in TEST_F() local
158 void *mem = alloc.Alloc(FRAME_SIZE); in TEST_F()
[all …]
Drunslots_allocator_test.cpp53 void AddMemoryPoolToAllocator(NonObjectAllocator &alloc) override in AddMemoryPoolToAllocator() argument
59 if (!alloc.AddMemoryPool(mem, DEFAULT_POOL_SIZE_FOR_ALLOC)) { in AddMemoryPoolToAllocator()
64 void AddMemoryPoolToAllocatorProtected(NonObjectAllocator &alloc) override in AddMemoryPoolToAllocatorProtected() argument
72 if (!alloc.AddMemoryPool(mem, DEFAULT_POOL_SIZE_FOR_ALLOC)) { in AddMemoryPoolToAllocatorProtected()
77 void ReleasePages(NonObjectAllocator &alloc) in ReleasePages() argument
79 alloc.ReleaseEmptyRunSlotsPagesUnsafe(); in ReleasePages()
89 LOG(DEBUG, ALLOC) << "Test RunSlots with size " << slotsSize; in TestRunSlots()
99 LOG(DEBUG, ALLOC) << "Iteration = " << i; in TestRunSlots()
118 LOG(DEBUG, ALLOC) << "SimpleAllocateDifferentObjSizeTest"; in TEST_F()
124 void *mem = allocator.Alloc(i); in TEST_F()
[all …]
Dfreelist_allocator_test.cpp69 void AddMemoryPoolToAllocator(NonObjectFreeListAllocator &alloc) override in AddMemoryPoolToAllocator() argument
73 … AllocatorType::FREELIST_ALLOCATOR, &alloc); in AddMemoryPoolToAllocator()
79 if (!alloc.AddMemoryPool(pool.GetMem(), pool.GetSize())) { in AddMemoryPoolToAllocator()
84 void AddMemoryPoolToAllocatorProtected(NonObjectFreeListAllocator &alloc) override in AddMemoryPoolToAllocatorProtected() argument
87 AddMemoryPoolToAllocator(alloc); in AddMemoryPoolToAllocatorProtected()
118 LOG(DEBUG, ALLOC) << "SimpleAllocateDifferentObjSizeTest"; in TEST_F()
124 void *mem = allocator.Alloc(i); in TEST_F()
126 LOG(DEBUG, ALLOC) << "Allocate obj with size " << i << " at " << std::hex << mem; in TEST_F()
205 void *mem = allocator.Alloc(MIN_ALLOC_SIZE); in TEST_F()
220 void *mem = allocator.Alloc(MIN_ALLOC_SIZE * 2U); in TEST_F()
[all …]
Dhumongous_obj_allocator_test.cpp60 void AddMemoryPoolToAllocator(NonObjectHumongousObjAllocator &alloc) override in AddMemoryPoolToAllocator() argument
62 AddMemoryPoolToAllocator(alloc, DEFAULT_POOL_SIZE_FOR_ALLOC); in AddMemoryPoolToAllocator()
65 void AddMemoryPoolToAllocator(NonObjectHumongousObjAllocator &alloc, size_t size) in AddMemoryPoolToAllocator() argument
71 … AllocatorType::HUMONGOUS_ALLOCATOR, &alloc); in AddMemoryPoolToAllocator()
77 if (!alloc.AddMemoryPool(pool.GetMem(), size)) { in AddMemoryPoolToAllocator()
82 void AddMemoryPoolToAllocatorProtected(NonObjectHumongousObjAllocator &alloc) override in AddMemoryPoolToAllocatorProtected() argument
85 AddMemoryPoolToAllocator(alloc); in AddMemoryPoolToAllocatorProtected()
118 void *firstObject = allocator.Alloc(FIRST_OBJECT_SIZE, OBJECT_ALIGNMENT); in TEST_F()
121 void *secondObject = allocator.Alloc(SECOND_OBJECT_SIZE, OBJECT_ALIGNMENT); in TEST_F()
127 LOG(DEBUG, ALLOC) << "SimpleAllocateDifferentObjSizeTest"; in TEST_F()
[all …]
Dregion_allocator_test.cpp122 void *mem = allocator.Alloc<ALLOC_TYPE>(OBJECT_SIZE); in AllocateObjectWithClass()
136 ASSERT_TRUE(allocator.Alloc(size) != nullptr) in AllocateRegularObject()
140 ASSERT_TRUE(allocator.Alloc(size) != nullptr); in AllocateRegularObject()
144 ASSERT_TRUE(allocator.Alloc(alignSize) == nullptr); in AllocateRegularObject()
147 ASSERT_TRUE(allocator.Alloc(alignSize) != nullptr); in AllocateRegularObject()
160 ASSERT_TRUE(allocator.Alloc(allocSize) == nullptr); in AllocateLargeObject()
163 ASSERT_TRUE(allocator.Alloc(allocSize) != nullptr); in AllocateLargeObject()
194 ASSERT_TRUE(allocator.Alloc(allocator.GetMaxRegularObjectSize() / 2UL + 1UL) != nullptr); in TEST_F()
197 ASSERT_TRUE(allocator.Alloc(allocator.GetMaxRegularObjectSize() / 2UL + 1UL) == nullptr); in TEST_F()
212 ASSERT_TRUE(allocator.Alloc(1) == nullptr); in TEST_F()
[all …]
/arkcompiler/runtime_core/static_core/compiler/tests/
Dlive_registers_test.cpp33 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(0U, 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(0U, 10… in TEST_F()
44 …intervals.push_back(alloc->New<LifeIntervals>(alloc, GetGraph()->CreateInstAdd(), LiveRange(0U, 2U… in TEST_F()
45 …intervals.push_back(alloc->New<LifeIntervals>(alloc, GetGraph()->CreateInstAdd(), LiveRange(2U, 3U… in TEST_F()
46 …intervals.push_back(alloc->New<LifeIntervals>(alloc, GetGraph()->CreateInstAdd(), LiveRange(5U, 6U… in TEST_F()
47 …intervals.push_back(alloc->New<LifeIntervals>(alloc, GetGraph()->CreateInstAdd(), LiveRange(6U, 8U… in TEST_F()
[all …]
/arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/maple_util/include/utils/
Dref_vector.h55 template <typename T, typename Alloc = std::allocator<T>>
57 using base_vector = std::vector<T *, Alloc>;
61 using allocator_type = Alloc;
75 explicit ref_vector(const allocator_type &alloc) noexcept : base(alloc) {}
79 const allocator_type &alloc = allocator_type()) = delete;
80 explicit ref_vector(size_type count, const allocator_type &alloc = allocator_type()) = delete;
84 ref_vector(Iter first, Iter last, const allocator_type &alloc = allocator_type()) = delete;
88 ref_vector(const ref_vector &other, const allocator_type &alloc) : base(other.base, alloc) {}
92 …ref_vector(ref_vector &&other, const allocator_type &alloc) noexcept : base(std::move(other), allo…
94 …ref_vector(std::initializer_list<value_type> init, const allocator_type &alloc = allocator_type())…
[all …]
/arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/maple_be/include/cg/
Dlive.h29 : AnalysisResult(&memPool), cgFunc(&func), alloc(&memPool), stackMp(func.GetStackMemPool()) in LiveAnalysis()
55 return memPool->New<SparseDataInfo>(maxRegCount, alloc); in NewLiveIn()
60 return memPool->New<SparseDataInfo>(maxRegCount, alloc); in NewLiveOut()
65 return memPool->New<SparseDataInfo>(maxRegCount, alloc); in NewDef()
70 return memPool->New<SparseDataInfo>(def, alloc); in NewDef()
75 return memPool->New<SparseDataInfo>(maxRegCount, alloc); in NewUse()
80 return memPool->New<SparseDataInfo>(use, alloc); in NewUse()
88 MapleAllocator alloc; variable
Dreg_alloc_lsra.h65 alloc(&memPool), in LiveInterval()
66 ranges(alloc.Adapter()), in LiveInterval()
67 usePositions(alloc.Adapter()), in LiveInterval()
68 noReloadPos(alloc.Adapter()) {} in LiveInterval()
278 MapleAllocator alloc; variable
364 liveIntervalsArray(alloc.Adapter()), in LSRALinearScanRegAllocator()
365 initialQue(alloc.Adapter()), in LSRALinearScanRegAllocator()
366 intParamQueue(alloc.Adapter()), in LSRALinearScanRegAllocator()
367 fpParamQueue(alloc.Adapter()), in LSRALinearScanRegAllocator()
368 callQueue(alloc.Adapter()), in LSRALinearScanRegAllocator()
[all …]
Dsparse_datainfo.h33 …SparseDataInfo(uint32 bitNum, const MapleAllocator &alloc) : allocator(alloc), info(allocator), ma… in SparseDataInfo() argument
35 SparseDataInfo(const SparseDataInfo &other, const MapleAllocator &alloc) in SparseDataInfo() argument
36 : allocator(alloc), in SparseDataInfo()
49 SparseDataInfo &Clone(MapleAllocator &alloc) const in Clone() argument
51 auto *dataInfo = alloc.New<SparseDataInfo>(*this, alloc); in Clone()
Dloop.h36 : alloc(allocator), in LoopDesc()
38 loopBBs(alloc.Adapter()), in LoopDesc()
39 exitBBs(alloc.Adapter()), in LoopDesc()
40 backEdges(alloc.Adapter()), in LoopDesc()
41 childLoops(alloc.Adapter()) in LoopDesc()
139 MapleAllocator &alloc;
153 alloc(&memPool), in LoopAnalysis()
156 loops(alloc.Adapter()), in LoopAnalysis()
157 bbLoopParent(cgFunc.GetAllBBSize(), nullptr, alloc.Adapter()) in LoopAnalysis()
220 MapleAllocator alloc;
Dstackmap.h70 …DeoptInfo(MapleAllocator &alloc) : deoptVreg2Opnd(alloc.Adapter()), deoptVreg2LocationInfo(alloc.A… in DeoptInfo() argument
131 ReferenceMap(MapleAllocator &alloc) : referenceLocations(alloc.Adapter()) {} in ReferenceMap() argument
175 StackMap(MapleAllocator &alloc) : deoptInfo(alloc), referenceMap(alloc) {} in StackMap() argument
/arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/maple_be/src/cg/
Dcg_irbuilder.cpp95 … return mp ? *mp->New<ImmOperand>(value, size, false) : *alloc.New<ImmOperand>(value, size, false); in CreateImm()
100 …return mp ? *mp->New<ImmOperand>(value, size, isSigned) : *alloc.New<ImmOperand>(value, size, isSi… in CreateImm()
106 : *alloc.New<ImmOperand>(symbol, offset, relocs, false); in CreateImm()
111 return mp ? *mp->New<OfstOperand>(offset, size) : *alloc.New<OfstOperand>(offset, size); in CreateOfst()
116 return mp ? *mp->New<MemOperand>(size) : *alloc.New<MemOperand>(size); in CreateMem()
125 return *alloc.New<MemOperand>(&baseOpnd, &ofstOperand, size); in CreateMem()
133 return *alloc.New<MemOperand>(size, &baseOpnd, nullptr, &ofstOperand, nullptr); in CreateMem()
142 …return *alloc.New<MemOperand>(MemOperand::kAddrModeLo12Li, size, baseOpnd, nullptr, &ofstOperand, … in CreateMem()
150 return *alloc.New<BitShiftOperand>(op, amount, bitLen); in CreateBitShift()
156 …RegOperand &rp = mp ? *mp->New<RegOperand>(vRegNO, size, type) : *alloc.New<RegOperand>(vRegNO, si… in CreateVReg()
[all …]
/arkcompiler/runtime_core/libpandabase/mem/
Darena_allocator.cpp74 void *mem = arenas_->Alloc(size, alignment); in AllocateAndAddNewPool()
83 LOG(DEBUG, ALLOC) << "Can not add new pool for " << SpaceTypeToString(space_type_); in AllocateAndAddNewPool()
86 mem = arenas_->Alloc(size, alignment); in AllocateAndAddNewPool()
93 void *ArenaAllocatorT<use_oom_handler>::Alloc(size_t size, Alignment align) in Alloc() function in panda::ArenaAllocatorT
96 LOG(DEBUG, ALLOC) << "ArenaAllocator: try to alloc " << size << " with align " << align; in Alloc()
99 LOG(DEBUG, ALLOC) << "\tTry to allocate from stack"; in Alloc()
100 ret = buff_.Alloc(size, align); in Alloc()
101 LOG_IF(ret, DEBUG, ALLOC) << "\tallocate from stack buffer"; in Alloc()
114 LOG(DEBUG, ALLOC) << "ArenaAllocator: allocated " << size << " bytes aligned by " << align; in Alloc()
122 LOG(DEBUG, ALLOC) << "ArenaAllocator: resize to new size " << new_size; in Resize()
[all …]
Darena-inl.h37 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()
/arkcompiler/runtime_core/static_core/libpandabase/mem/
Darena_allocator.cpp68 void *mem = arenas_->Alloc(size, alignment); in AllocateAndAddNewPool()
77 LOG(DEBUG, ALLOC) << "Can not add new pool for " << SpaceTypeToString(spaceType_); in AllocateAndAddNewPool()
80 mem = arenas_->Alloc(size, alignment); in AllocateAndAddNewPool()
87 void *ArenaAllocatorT<USE_OOM_HANDLER>::Alloc(size_t size, Alignment align) in Alloc() function in ark::ArenaAllocatorT
90 LOG(DEBUG, ALLOC) << "ArenaAllocator: try to alloc " << size << " with align " << align; in Alloc()
93 LOG(DEBUG, ALLOC) << "\tTry to allocate from stack"; in Alloc()
94 ret = buff_.Alloc(size, align); in Alloc()
95 LOG_IF(ret, DEBUG, ALLOC) << "\tallocate from stack buffer"; in Alloc()
108 LOG(DEBUG, ALLOC) << "ArenaAllocator: allocated " << size << " bytes aligned by " << align; in Alloc()
116 LOG(DEBUG, ALLOC) << "ArenaAllocator: resize to new size " << newSize; in Resize()
[all …]
Darena-inl.h37 LOG(DEBUG, ALLOC) << "Arena: created with buff addr = " << buff << " size = " << buffSize; 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()
/arkcompiler/runtime_core/static_core/libpandabase/tests/
Dlogger_test.cpp35 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); in DEATH_TEST()
50 EXPECT_TRUE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); in DEATH_TEST()
72 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); in DEATH_TEST()
153 EXPECT_TRUE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); in TEST()
170 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); in TEST()
176 EXPECT_TRUE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); in TEST()
190 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); in TEST()
196 EXPECT_TRUE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); in TEST()
208 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC)); in TEST()
218 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::WARNING, Logger::Component::ALLOC)); in TEST()
[all …]
Dalloc_tracker_test.cpp113 AllocInfo alloc; in TEST() local
115 out.read(reinterpret_cast<char *>(&alloc), sizeof(alloc)); in TEST()
118 ASSERT_EQ(DetailAllocTracker::ALLOC_TAG, alloc.tag); in TEST()
119 ASSERT_EQ(0U, alloc.id); in TEST()
120 ASSERT_EQ(20U, alloc.size); in TEST()
121 ASSERT_EQ(static_cast<uint32_t>(SpaceType::SPACE_TYPE_INTERNAL), alloc.space); in TEST()
122 ASSERT_EQ(0U, alloc.stacktraceId); in TEST()
/arkcompiler/runtime_core/libpandabase/tests/
Dalloc_tracker_test.cpp110 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()
Dlogger_test.cpp43 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC));
58 EXPECT_TRUE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC));
80 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC));
161 EXPECT_TRUE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC));
178 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC));
184 EXPECT_TRUE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC));
198 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC));
204 EXPECT_TRUE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC));
216 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::FATAL, Logger::Component::ALLOC));
226 EXPECT_FALSE(Logger::IsLoggingOn(Logger::Level::WARNING, Logger::Component::ALLOC));
[all …]
/arkcompiler/runtime_core/static_core/runtime/mem/
Dpygote_space_allocator-inl.h28 #define LOG_PYGOTE_SPACE_ALLOCATOR(level) LOG(level, ALLOC) << "PygoteSpaceAllocator: "
90 inline void *PygoteSpaceAllocator<AllocConfigT>::Alloc(size_t size, Alignment align) in Alloc() function
94 // alloc from runslots firstly, if failed, try to alloc from new arena in Alloc()
97 void *obj = runslotsAlloc_.template Alloc<true, false>(size, align); in Alloc()
105 obj = runslotsAlloc_.Alloc(size, align); in Alloc()
116 … LOG(FATAL, ALLOC) << "PygoteSpaceAllocator: couldn't add memory pool to object allocator"; in Alloc()
118 // alloc object again in Alloc()
119 obj = runslotsAlloc_.Alloc(size, align); in Alloc()
122 obj = arena_->Alloc(size, align); in Alloc()
133 obj = arena_->Alloc(size, align); in Alloc()
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/interop_js/tests/proxies/mem/items_pool/
Dtest_items_pool.cpp128 // Step1, Alloc in TEST_F()
132 // Step2, Alloc in TEST_F()
140 // Step3, Alloc in TEST_F()
153 // Step5, Alloc in TEST_F()
161 // Step6, Alloc in TEST_F()
169 // Step7, Alloc in TEST_F()
177 // Step8, Alloc in TEST_F()
185 // Step9, Alloc in TEST_F()
193 // Step10, Alloc in TEST_F()
201 // Step11, Alloc, out of memory in TEST_F()
[all …]
/arkcompiler/runtime_core/common_interfaces/objects/utils/
Dobjects_traits.h57 template <typename Alloc, typename T>
58 struct is_std_vector_of<std::vector<T, Alloc>, T> : std::true_type {};
67 template <typename Alloc, typename U>
68 using rebind_alloc_t = typename std::allocator_traits<Alloc>::template rebind_alloc<U>;

12345678910