Home
last modified time | relevance | path

Searched full:pool (Results 1 – 25 of 84) sorted by relevance

1234

/arkcompiler/runtime_core/verification/util/tests/
Dobj_pool_test.cpp32 struct Pool : public ObjPool<S, std::vector, I, C> { struct
33 Pool(I i, C c) : ObjPool<S, std::vector, I, C> {i, c} {} in Pool() argument
46 Pool pool {h, [&](S &s) { result -= s.a; }}; in TEST() local
49 auto q = pool.New(); in TEST()
50 auto p = pool.New(); in TEST()
51 EXPECT_EQ(pool.Count(), 2); in TEST()
52 EXPECT_EQ(pool.FreeCount(), 0); in TEST()
53 EXPECT_EQ(pool.AccCount(), 2); in TEST()
57 EXPECT_EQ(pool.Count(), 2); in TEST()
58 EXPECT_EQ(pool.FreeCount(), 2); in TEST()
[all …]
/arkcompiler/runtime_core/libpandabase/mem/
Dmmap_mem_pool.h38 …explicit MmapPool(Pool pool, FreePoolsIter free_pools_iter) : pool_(pool), free_pools_iter_(free_p… in MmapPool() argument
52 pool_ = Pool(size, GetMem()); in SetSize()
60 …// A free pool will be store in the free_pools_, and it's iterator will be recorded in the free_po…
61 // If the free_pools_iter_ is equal to the end of free_pools_, the pool is used.
78 Pool pool_;
79 // record the iterator of the pool in the multimap
89 for (auto &pool : pool_map_) { in ~MmapPoolMap()
90 delete pool.second; in ~MmapPoolMap()
97 …// Find a free pool with enough size in the map. Split the pool, if the pool size is larger than r…
98 Pool PopFreePool(size_t size);
[all …]
Dmem_pool.h27 class Pool {
29 explicit constexpr Pool(size_t size, void *mem) : size_(size), mem_(mem) {} in Pool() function
30 explicit Pool(std::pair<size_t, void *> pool) : size_(pool.first), mem_(pool.second) {} in Pool() argument
42 bool operator==(const Pool &other) const
47 bool operator!=(const Pool &other) const
52 ~Pool() = default;
54 DEFAULT_COPY_SEMANTIC(Pool);
55 DEFAULT_MOVE_SEMANTIC(Pool);
62 constexpr Pool NULLPOOL {0, nullptr};
82 // because we set up arena at the first bytes of the pool
[all …]
Dmmap_mem_pool-inl.h32 inline Pool MmapPoolMap::PopFreePool(size_t size) in PopFreePool()
45 Pool pool(size, element_mem); in PopFreePool()
48 Pool new_pool(element_size - size, ToVoidPtr(ToUintPtr(element_mem) + size)); in PopFreePool()
55 return pool; in PopFreePool()
58 inline void MmapPoolMap::PushFreePool(Pool pool) in PushFreePool() argument
60 auto mmap_pool_element = pool_map_.find(pool.GetMem()); in PushFreePool()
62 LOG_MMAP_MEM_POOL(FATAL) << "can't find mmap pool in the pool map when PushFreePool"; in PushFreePool()
91 inline void MmapPoolMap::AddNewPool(Pool pool) in AddNewPool() argument
93 auto new_mmap_pool = new MmapPool(pool, free_pools_.end()); in AddNewPool()
94 pool_map_.insert(std::pair<void *, MmapPool *>(pool.GetMem(), new_mmap_pool)); in AddNewPool()
[all …]
Dmalloc_mem_pool-inl.h73 inline Pool MallocMemPool::AllocPoolImpl(size_t size, [[maybe_unused]] SpaceType space_type, in AllocPoolImpl()
77 LOG_MALLOC_MEM_POOL(DEBUG) << "Try to get new pool with size " << std::dec << size << " for " in AllocPoolImpl()
80 …LOG_MALLOC_MEM_POOL(DEBUG) << "Allocated new pool with size " << std::dec << size << " at addr = "… in AllocPoolImpl()
82 return Pool(size, mem); in AllocPoolImpl()
88 …LOG_MALLOC_MEM_POOL(DEBUG) << "Try to free pool with size " << std::dec << size << " at addr = " <… in FreePoolImpl()
90 LOG_MALLOC_MEM_POOL(DEBUG) << "Free pool call finished"; in FreePoolImpl()
Dmalloc_mem_pool.h23 // Simple Mem Pool without cache
32 static Pool AllocPoolImpl(size_t size, SpaceType space_type, AllocatorType allocator_type,
/arkcompiler/runtime_core/libpandabase/tests/
Dpool_map_test.cpp46 …void AddToPoolMap(Pool pool, SpaceType space_type, AllocatorType allocator_type, void *allocator_a… in AddToPoolMap() argument
49 allocator_addr = pool.GetMem(); in AddToPoolMap()
51 pools_.push_back(pool); in AddToPoolMap()
52 … pool_map_.AddPoolToMap(pool.GetMem(), pool.GetSize(), space_type, allocator_type, allocator_addr); in AddToPoolMap()
55 void RemovePoolFromMap(Pool pool) in RemovePoolFromMap() argument
57 auto items = std::remove(pools_.begin(), pools_.end(), pool); in RemovePoolFromMap()
60 pool_map_.RemovePoolFromMap(pool.GetMem(), pool.GetSize()); in RemovePoolFromMap()
93 …void CheckRandomPoolAddress(Pool pool, SpaceType space_type, AllocatorType allocator_type, uintptr… in CheckRandomPoolAddress() argument
95 void *pool_addr = RandAddrFromPool(pool); in CheckRandomPoolAddress()
102 void *RandAddrFromPool(Pool pool) const in RandAddrFromPool()
[all …]
Dmmap_mem_pool_test.cpp107Pool pool_with_alloc_addr = memPool->AllocPool(POOL_SIZE, SpaceType::SPACE_TYPE_OBJECT, ALLOC_TYPE…
108Pool pool_without_alloc_addr = memPool->AllocPool(POOL_SIZE, SpaceType::SPACE_TYPE_OBJECT, ALLOC_T…
137Pool object_pool = mem_pool->AllocPool(1_MB, SpaceType::SPACE_TYPE_OBJECT, AllocatorType::BUMP_ALL…
138Pool internal_pool = mem_pool->AllocPool(2_MB, SpaceType::SPACE_TYPE_COMPILER, AllocatorType::BUMP…
139Pool code_pool = mem_pool->AllocPool(2_MB, SpaceType::SPACE_TYPE_CODE, AllocatorType::BUMP_ALLOCAT…
140Pool compiler_pool = mem_pool->AllocPool(2_MB, SpaceType::SPACE_TYPE_INTERNAL, AllocatorType::BUMP…
/arkcompiler/runtime_core/verification/util/
Dobj_pool.h33 Accessor() : idx {0}, pool {nullptr}, prev {nullptr}, next {nullptr} {} in Accessor()
34 …Accessor(std::size_t index, ObjPool *obj_pool) : idx {index}, pool {obj_pool}, prev {nullptr}, nex… in Accessor()
38 Accessor(const Accessor &p) : idx {p.idx}, pool {p.pool}, prev {nullptr}, next {nullptr} in Accessor()
42 Accessor(Accessor &&p) : idx {p.idx}, pool {p.pool}, prev {p.prev}, next {p.next} in Accessor()
52 pool = p.pool;
60 pool = p.pool;
73 return pool->Storage[idx];
77 return pool->Storage[idx];
81 return pool != nullptr;
93 pool = nullptr; in Reset()
[all …]
/arkcompiler/runtime_core/runtime/mem/
Dhumongous_obj_allocator-inl.h120 // Each memory pool is PAGE_SIZE aligned, so to get a header we need just to align a pointer in FreeUnsafe()
156 LOG_HUMONGOUS_OBJ_ALLOCATOR(DEBUG) << " check pool at addr " << std::hex << current_pool; in IterateOverObjects()
169 …LOG_HUMONGOUS_OBJ_ALLOCATOR(DEBUG) << "Add memory pool to HumongousObjAllocator from " << std::he… in AddMemoryPool()
199 LOG_HUMONGOUS_OBJ_ALLOCATOR(DEBUG) << "Try to insert pool with size " << header->GetPoolSize() in InsertPool()
208 // We have a crowded out pool or the "header" argument in mem_header in InsertPool()
251 // Try to find a pool with this range in IterateOverObjectsInRange()
259 // Use current pool here because it is page aligned in IterateOverObjectsInRange()
263 // Check that this range is located in the same pool in IterateOverObjectsInRange()
350 void HumongousObjAllocator<AllocConfigT, LockConfigT>::MemoryPoolList::Pop(MemoryPoolHeader *pool) in Pop() argument
352 …LOG_HUMONGOUS_OBJ_ALLOCATOR(DEBUG) << "Pop a pool with addr " << std::hex << pool << " from the po… in Pop()
[all …]
Dheap_space.cpp95 // If saved pool size was very big and such pool can not be allocate after GC in ComputeNewSize()
96 // then we increase space to allocate this pool in ComputeNewSize()
100 // Free bytes after increase space for new pool will = 0, so yet increase space in ComputeNewSize()
116 // If can allocate pool (from free pool map or non-used memory) then just do it in WillAlloc()
121 …// If we allocate pool during GC work then we must allocate new pool anyway, so we wiil try to inc… in WillAlloc()
123 …// if requested pool size greater free bytes in current heap space and non occupied memory then we… in WillAlloc()
124 // allocate such pool, so we need to trigger GC in WillAlloc()
128 // In this case we need increase space for allocate new pool in WillAlloc()
140 inline Pool HeapSpace::TryAllocPoolBase(size_t pool_size, SpaceType space_type, AllocatorType alloc… in TryAllocPoolBase()
145 // Increase heap space if needed and allocate pool in TryAllocPoolBase()
[all …]
Dhumongous_obj_allocator.h54 * using the whole memory pool for each.
136 * \brief returns minimum pool size to allocate an object with \param obj_size bytes
141 // To note: It is not the smallest size of the pool in GetMinPoolSize()
235 void Insert(MemoryPoolHeader *pool);
237 void Pop(MemoryPoolHeader *pool);
240 * \brief Try to find a pool suitable for object with \param size.
241 * @return a pointer to pool header on success, nullptr otherwise.
257 bool IsInThisList(MemoryPoolHeader *pool);
264 // When we free a pool, we try to insert in into ReservedMemoryPools first:
265 // - If the pool is too big for ReservedMemoryPools, we skip inserting.
[all …]
Dheap_space.h51 // | | (if need new pool)
59 // | Pool +-------------+
98 * \brief Try to allocate pool via PoolManager
100 …[[nodiscard]] virtual Pool TryAllocPool(size_t pool_size, SpaceType space_type, AllocatorType allo…
110 * \brief Free pool via PoolManager
181 …// If we have too big pool for allocation then after space increasing we can have not memory for t…
182 // so we save pool size and increase heap space to allocate such pool
197 …[[nodiscard]] Pool TryAllocPoolBase(size_t pool_size, SpaceType space_type, AllocatorType allocato…
259 // | shared pool (use for G1-GC) young, tenured and free pools …
264 // |~~~| | |~~~|~~~| |~~~~~| pool |~~~~~~~~~| pool |~~~~~~~~~~~~~| …
[all …]
Dinternal_allocator.cpp145 // Get rid of extra pool adding to the allocator in AllocInRunSlots()
153 … LOG_INTERNAL_ALLOCATOR(DEBUG) << "RunSlotsAllocator didn't allocate memory, try to add new pool"; in AllocInRunSlots()
154 … auto pool = PoolManager::GetMmapMemPool()->AllocPool(pool_size, SpaceType::SPACE_TYPE_INTERNAL, in AllocInRunSlots() local
156 if (UNLIKELY(pool.GetMem() == nullptr)) { in AllocInRunSlots()
159 runslots_allocator->AddMemoryPool(pool.GetMem(), pool.GetSize()); in AllocInRunSlots()
160 …OG_INTERNAL_ALLOCATOR(DEBUG) << "RunSlotsAllocator try to allocate memory again after pool adding"; in AllocInRunSlots()
195 // Get rid of extra pool adding to the allocator in AllocViaPandaAllocators()
203 … LOG_INTERNAL_ALLOCATOR(DEBUG) << "FreeListAllocator didn't allocate memory, try to add new pool"; in AllocViaPandaAllocators()
205 auto pool = PoolManager::GetMmapMemPool()->AllocPool( in AllocViaPandaAllocators() local
207 if (UNLIKELY(pool.GetMem() == nullptr)) { in AllocViaPandaAllocators()
[all …]
Dbump-allocator.h50 // | Memory Pool
75 * Construct BumpPointer allocator with provided pool
76 * @param pool - pool
78 explicit BumpPointerAllocator(Pool pool, SpaceType type_allocation, MemStatsType *mem_stats,
109 * \brief Add an extra memory pool to the allocator.
110 * The memory pool must be located just after the current memory given to this allocator.
111 * @param mem - pointer to the extra memory pool.
112 * @param size - a size of the extra memory pool.
Drunslots_allocator-inl.h286 …LOG_RUNSLOTS_ALLOCATOR(DEBUG) << "Get new memory pool with size " << size << " bytes, at addr " <<… in AddMemoryPool()
293 // TODO(aemelenko): The size of the pool is fixed by now, in AddMemoryPool()
297 …<< "Can't add new memory pool to this allocator because the memory size is equal to " << MIN_POOL_… in AddMemoryPool()
302 … << "Can't add new memory pool to this allocator. Maybe we already added too much memory pools."; in AddMemoryPool()
534 …<< "MemPoolManager: occupied_tail_ doesn't have memory for RunSlots, get new pool from free pools"; in GetNewRunSlots()
580 auto pool = static_cast<PoolListElement *>(ToVoidPtr(runslots->GetPoolPointer())); in ReturnAndReleaseRunSlotsMemory() local
581 if (!pool->HasMemoryForRunSlots()) { in ReturnAndReleaseRunSlotsMemory()
582 ASSERT(partially_occupied_head_ != pool); in ReturnAndReleaseRunSlotsMemory()
583 // We should add move this pool to the end of a occupied list in ReturnAndReleaseRunSlotsMemory()
584 if (pool != occupied_tail_) { in ReturnAndReleaseRunSlotsMemory()
[all …]
/arkcompiler/runtime_core/runtime/mem/gc/hybrid-gc/
Dhybrid_object_allocator.cpp65 auto pool = heap_space_.TryAllocPool(pool_size, SpaceType::SPACE_TYPE_OBJECT, in AllocateInLargeAllocator() local
67 if (pool.GetMem() == nullptr || in AllocateInLargeAllocator()
68 !large_object_allocator_->AddMemoryPool(pool.GetMem(), pool.GetSize())) { in AllocateInLargeAllocator()
69 … LOG(FATAL, ALLOC) << "HybridObjectAllocator: couldn't add memory pool to large object allocator"; in AllocateInLargeAllocator()
78 auto pool = in AllocateInLargeAllocator() local
81 if (pool.GetMem() == nullptr || in AllocateInLargeAllocator()
82 !humongous_object_allocator_->AddMemoryPool(pool.GetMem(), pool.GetSize())) { in AllocateInLargeAllocator()
84 … << "HybridObjectAllocator: couldn't add memory pool to humongous object allocator"; in AllocateInLargeAllocator()
/arkcompiler/runtime_core/runtime/tests/
Dhumongous_obj_allocator_test.cpp65Pool pool = PoolManager::GetMmapMemPool()->AllocPool(AlignUp(size, PANDA_POOL_ALIGNMENT_IN_BYTES), in AddMemoryPoolToAllocator() local
68 ASSERT(pool.GetSize() >= size); in AddMemoryPoolToAllocator()
69 if (pool.GetMem() == nullptr) { in AddMemoryPoolToAllocator()
70 ASSERT_TRUE(0 && "Can't get a new pool from PoolManager"); in AddMemoryPoolToAllocator()
72 allocated_pools_by_pool_manager_.push_back(pool); in AddMemoryPoolToAllocator()
73 if (!alloc.AddMemoryPool(pool.GetMem(), size)) { in AddMemoryPoolToAllocator()
74 ASSERT_TRUE(0 && "Can't add mem pool to allocator"); in AddMemoryPoolToAllocator()
80 …// We use common PoolManager from Runtime. Therefore, we have the same pool allocation for both ca… in AddMemoryPoolToAllocatorProtected()
97 std::vector<Pool> allocated_pools_by_pool_manager_;
98 // Mutex, which allows only one thread to add pool to the pool vector
Dfreelist_allocator_test.cpp70Pool pool = PoolManager::GetMmapMemPool()->AllocPool(DEFAULT_POOL_SIZE_FOR_ALLOC, SpaceType::SPACE… in AddMemoryPoolToAllocator() local
72 ASSERT(pool.GetSize() == DEFAULT_POOL_SIZE_FOR_ALLOC); in AddMemoryPoolToAllocator()
73 if (pool.GetMem() == nullptr) { in AddMemoryPoolToAllocator()
74 ASSERT_TRUE(0 && "Can't get a new pool from PoolManager"); in AddMemoryPoolToAllocator()
76 allocated_pools_by_pool_manager_.push_back(pool); in AddMemoryPoolToAllocator()
77 if (!alloc.AddMemoryPool(pool.GetMem(), pool.GetSize())) { in AddMemoryPoolToAllocator()
78 ASSERT_TRUE(0 && "Can't add mem pool to allocator"); in AddMemoryPoolToAllocator()
84 …// We use common PoolManager from Runtime. Therefore, we have the same pool allocation for both ca… in AddMemoryPoolToAllocatorProtected()
105 std::vector<Pool> allocated_pools_by_pool_manager_;
108 // Mutex, which allows only one thread to add pool to the pool vector
[all …]
Dheap_space_test.cpp150 ASSERT_EQ(pool_2, NULLPOOL) << "We now can't allocate pool"; in TEST_F()
174 // Check young pool allocation in TEST_F()
193 // Try too big pool, now no space for such pool in TEST_F()
196 ASSERT_EQ(pool_2, NULLPOOL) << "Now no space for such pool, so we must have NULLPOOL"; in TEST_F()
199 …ASSERT_TRUE(gen_spaces_->CanAllocInSpace(false, SECOND_POOL_SIZE)) << "We can allocate pool during… in TEST_F()
202 ASSERT_EQ(pool_2.GetSize(), SECOND_POOL_SIZE) << "We can allocate pool during GC"; in TEST_F()
/arkcompiler/ets_runtime/ecmascript/tests/
Decma_string_table_test.cpp51 * @tc.desc: Write empty string emptyStr to the Intern pool and takes the hash code as its index.
68 …btain EcmaString string from utf8 encoded data. If the string already exists in the detention pool,
69 … it will be returned directly. If not, it will be added to the detention pool and then returned.
89 …tain EcmaString string from utf16 encoded data. If the string already exists in the detention pool,
90 … it will be returned directly. If not, it will be added to the detention pool and then returned.
111 …tain EcmaString string from another EcmaString. If the string already exists in the detention pool,
112 … it will be returned directly. If not, it will be added to the detention pool and then returned.
/arkcompiler/runtime_core/runtime/include/mem/
Dallocator-inl.h41 …auto pool = heap_space->TryAllocPool(pool_size, space_type, AllocT::GetAllocatorType(), object_all… in AddPoolsAndAlloc() local
42 if (UNLIKELY(pool.GetMem() == nullptr)) { in AddPoolsAndAlloc()
45 bool added_memory_pool = object_allocator->AddMemoryPool(pool.GetMem(), pool.GetSize()); in AddPoolsAndAlloc()
47 LOG(FATAL, ALLOC) << "ObjectAllocator: couldn't add memory pool to object allocator"; in AddPoolsAndAlloc()
/arkcompiler/ets_frontend/test262/
Dharness.patch31 -const pool = new AgentPool(
43 +const pool = new AgentPool(
54 const results = zip(pool, tests).pipe(
56 return pool.runTest(pair);
69 diff --git a/lib/agent-pool.js b/lib/agent-pool.js
71 --- a/lib/agent-pool.js
72 +++ b/lib/agent-pool.js
/arkcompiler/ets_runtime/ecmascript/mem/
Dheap_region_allocator.cpp36 …auto pool = MemMapAllocator::GetInstance()->Allocate(capacity, DEFAULT_REGION_SIZE, isRegular, pro… in AllocateAlignedRegion() local
37 void *mapMem = pool.GetMem(); in AllocateAlignedRegion()
39 LOG_ECMA_MEM(FATAL) << "pool is empty " << annoMemoryUsage_.load(std::memory_order_relaxed); in AllocateAlignedRegion()
/arkcompiler/runtime_core/verification/jobs/
Dthread_pool.cpp49 << "after the thread pool started shutdown, ignoring"; in Process()
115 LOG(ERROR, VERIFIER) << "Insufficient memory to initialize verifier thread pool"; in Initialize()
120 LOG(INFO, VERIFIER) << "Initialized verifier thread pool"; in Initialize()
147 LOG(INFO, VERIFIER) << "Destroyed verifier thread pool"; in Destroy()

1234