Home
last modified time | relevance | path

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

12345678

/arkcompiler/runtime_core/static_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() function
39 static void VerifierTestObjPool1(Pool<I, C> &pool, int &result) in VerifierTestObjPool1() argument
42 auto q = pool.New(); in VerifierTestObjPool1()
43 auto p = pool.New(); in VerifierTestObjPool1()
44 EXPECT_EQ(pool.Count(), 2U); in VerifierTestObjPool1()
45 EXPECT_EQ(pool.FreeCount(), 0U); in VerifierTestObjPool1()
46 EXPECT_EQ(pool.AccCount(), 2U); in VerifierTestObjPool1()
50 EXPECT_EQ(pool.Count(), 2U); in VerifierTestObjPool1()
51 EXPECT_EQ(pool.FreeCount(), 2U); in VerifierTestObjPool1()
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/interop_js/tests/proxies/mem/items_pool/
Dtest_items_pool.cpp29 using Pool = ItemsPool<Item, 3U>; typedef in ark::ets::interop::js::ets_proxy::testing::ItemsPoolTest
30 using PaddedItem = Pool::PaddedItem;
34 static PaddedItem *GetData(const std::unique_ptr<Pool> &pool) in GetData() argument
36 return pool->data_; in GetData()
39 static PaddedItem *&GetCurrentPos(const std::unique_ptr<Pool> &pool) in GetCurrentPos() argument
41 return pool->currentPos_; in GetCurrentPos()
44 static PaddedItem *&GetFreeList(const std::unique_ptr<Pool> &pool) in GetFreeList() argument
46 return pool->freeList_; in GetFreeList()
49 static std::unique_ptr<Pool> CreatePool() in CreatePool()
51 size_t size = Pool::MAX_POOL_SIZE; in CreatePool()
[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 …]
/arkcompiler/runtime_core/static_core/libpandabase/mem/
Dmmap_mem_pool.h41 explicit MmapPool(Pool pool, FreePoolsIter freePoolsIter, bool returnedToOs = true)
42 : pool_(pool), returnedToOs_(returnedToOs), freePoolsIter_(freePoolsIter) in pool_() argument
68 pool_ = Pool(size, GetMem()); in SetSize()
76 …// A free pool will be store in the free_pools_, and it's iterator will be recorded in the freePoo…
77 // If the freePoolsIter_ is equal to the end of freePools_, the pool is used.
94 Pool pool_;
96 // record the iterator of the pool in the multimap
100 /// @brief Class represents current pool that is returning to OS
104 explicit UnreturnedToOSPool(MmapPool *pool) : pool_(pool) in UnreturnedToOSPool() argument
111 * and creates a pool with @param size that needs to be cleared
[all …]
Dmmap_mem_pool-inl.h39 inline Pool MmapPoolMap::PopFreePool(size_t size) in PopFreePool()
56 Pool pool(size, elementMem); in PopFreePool()
59 Pool newPool(elementSize - size, ToVoidPtr(ToUintPtr(elementMem) + size)); in PopFreePool()
68 uintptr_t poolStart = ToUintPtr(pool.GetMem()); in PopFreePool()
69 size_t poolSize = pool.GetSize(); in PopFreePool()
70 …MMAP_MEM_POOL(DEBUG) << "Return pages to OS from Free Pool to get zeroed memory: start = " << pool in PopFreePool()
74 return pool; in PopFreePool()
79 inline std::pair<size_t, OSPagesPolicy> MmapPoolMap::PushFreePool(Pool pool) in PushFreePool() argument
82 auto mmapPoolElement = poolMap_.find(pool.GetMem()); in PushFreePool()
84 LOG_MMAP_MEM_POOL(FATAL) << "can't find mmap pool in the pool map when PushFreePool"; in PushFreePool()
[all …]
Dmem_pool.h37 class Pool {
39 explicit constexpr Pool(size_t size, void *mem) : size_(size), mem_(mem) {} in Pool() function
40 explicit Pool(std::pair<size_t, void *> pool) : size_(pool.first), mem_(pool.second) {} in Pool() argument
52 bool operator==(const Pool &other) const
57 bool operator!=(const Pool &other) const
62 ~Pool() = default;
64 DEFAULT_COPY_SEMANTIC(Pool);
65 DEFAULT_MOVE_SEMANTIC(Pool);
72 constexpr Pool NULLPOOL {0, nullptr};
93 // because we set up arena at the first bytes of the pool
[all …]
/arkcompiler/runtime_core/static_core/libpandabase/tests/
Dpool_map_test.cpp50 …void AddToPoolMap(Pool pool, SpaceType spaceType, AllocatorType allocatorType, void *allocatorAddr… in AddToPoolMap() argument
53 allocatorAddr = pool.GetMem(); in AddToPoolMap()
55 pools_.push_back(pool); in AddToPoolMap()
56 … poolMap_.AddPoolToMap(pool.GetMem(), pool.GetSize(), spaceType, allocatorType, allocatorAddr); in AddToPoolMap()
59 void RemovePoolFromMap(Pool pool) in RemovePoolFromMap() argument
61 auto items = std::remove(pools_.begin(), pools_.end(), pool); in RemovePoolFromMap()
64 poolMap_.RemovePoolFromMap(pool.GetMem(), pool.GetSize()); in RemovePoolFromMap()
100 …void CheckRandomPoolAddress(Pool pool, SpaceType spaceType, AllocatorType allocatorType, uintptr_t… in CheckRandomPoolAddress() argument
102 void *poolAddr = RandAddrFromPool(pool); in CheckRandomPoolAddress()
109 void *RandAddrFromPool(Pool pool) const in RandAddrFromPool()
[all …]
Dmmap_mem_pool_test.cpp50 void FreePoolWithPolicy(MmapMemPool *memPool, OSPagesPolicy policy, Pool &pool) in FreePoolWithPolicy() argument
53 memPool->template FreePool<OSPagesPolicy::NO_RETURN>(pool.GetMem(), pool.GetSize()); in FreePoolWithPolicy()
55 … memPool->template FreePool<OSPagesPolicy::IMMEDIATE_RETURN>(pool.GetMem(), pool.GetSize()); in FreePoolWithPolicy()
66 std::array<Pool, POOL_COUNT> pools {{NULLPOOL, NULLPOOL, NULLPOOL}}; in ReturnedToOsTest()
67 Pool fourthPool = NULLPOOL; in ReturnedToOsTest()
209Pool poolWithAllocAddr = memPool->AllocPool(POOL_SIZE, SpaceType::SPACE_TYPE_OBJECT, ALLOC_TYPE, a… in TEST_F()
210Pool poolWithoutAllocAddr = memPool->AllocPool(POOL_SIZE, SpaceType::SPACE_TYPE_OBJECT, ALLOC_TYPE… in TEST_F()
238Pool objectPool = memPool->AllocPool(1_GB, SpaceType::SPACE_TYPE_OBJECT, AllocatorType::BUMP_ALLOC… in TEST_F()
239Pool internalPool = memPool->AllocPool(1_GB, SpaceType::SPACE_TYPE_COMPILER, AllocatorType::BUMP_A… in TEST_F()
240Pool codePool = memPool->AllocPool(1_GB, SpaceType::SPACE_TYPE_CODE, AllocatorType::BUMP_ALLOCATOR… in TEST_F()
[all …]
/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 …]
/arkcompiler/runtime_core/static_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 << currentPool; 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()
250 // Try to find a pool with this range in IterateOverObjectsInRange()
258 // Use current pool here because it is page aligned in IterateOverObjectsInRange()
262 // Check that this range is located in the same pool in IterateOverObjectsInRange()
349 void HumongousObjAllocator<AllocConfigT, LockConfigT>::MemoryPoolList::Pop(MemoryPoolHeader *pool) in Pop() argument
351 …LOG_HUMONGOUS_OBJ_ALLOCATOR(DEBUG) << "Pop a pool with addr " << std::hex << pool << " from the po… in Pop()
[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.
255 bool IsInThisList(MemoryPoolHeader *pool);
262 // When we free a pool, we try to insert in into ReservedMemoryPools first:
263 // - If the pool is too big for ReservedMemoryPools, we skip inserting.
[all …]
Dheap_space.cpp99 // If saved pool size was very big and such pool can not be allocate after GC in ComputeNewSize()
100 // then we increase space to allocate this pool in ComputeNewSize()
104 // Free bytes after increase space for new pool will = 0, so yet increase space in ComputeNewSize()
120 // If can allocate pool (from free pool map or non-used memory) then just do it in WillAlloc()
125 …// If we allocate pool during GC work then we must allocate new pool anyway, so we will try to inc… in WillAlloc()
127 …// if requested pool size greater free bytes in current heap space and non occupied memory then we… in WillAlloc()
128 // allocate such pool, so we need to trigger GC in WillAlloc()
132 // In this case we need increase space for allocate new pool in WillAlloc()
152 inline Pool HeapSpace::TryAllocPoolBase(size_t poolSize, SpaceType spaceType, AllocatorType allocat… in TryAllocPoolBase()
157 // Increase heap space if needed and allocate pool in TryAllocPoolBase()
[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(poolSize, SpaceType::SPACE_TYPE_INTERNAL, in AllocInRunSlots() local
156 if (UNLIKELY(pool.GetMem() == nullptr)) { in AllocInRunSlots()
159 runslotsAllocator->AddMemoryPool(pool.GetMem(), pool.GetSize()); in AllocInRunSlots()
160 …OG_INTERNAL_ALLOCATOR(DEBUG) << "RunSlotsAllocator try to allocate memory again after pool adding"; in AllocInRunSlots()
192 // Get rid of extra pool adding to the allocator in AllocViaFreeListAllocator()
200 … LOG_INTERNAL_ALLOCATOR(DEBUG) << "FreeListAllocator didn't allocate memory, try to add new pool"; in AllocViaFreeListAllocator()
202 … auto pool = PoolManager::GetMmapMemPool()->AllocPool(poolSize, SpaceType::SPACE_TYPE_INTERNAL, in AllocViaFreeListAllocator() local
204 if (UNLIKELY(pool.GetMem() == nullptr)) { in AllocViaFreeListAllocator()
[all …]
Dheap_space.h51 // | | (if need new pool)
59 // | Pool +-------------+
93 /// @brief Try to allocate pool via PoolManager
94 …[[nodiscard]] virtual Pool TryAllocPool(size_t poolSize, SpaceType spaceType, AllocatorType alloca…
101 /// @brief Free pool via PoolManager
182 …// If we have too big pool for allocation then after space increasing we can have not memory for t…
183 // so we save pool size and increase heap space to allocate such pool
198 …[[nodiscard]] Pool TryAllocPoolBase(size_t poolSize, SpaceType spaceType, AllocatorType allocatorT…
256 // | shared pool (use for G1-GC) young, tenured and free pools …
261 // |~~~| | |~~~|~~~| |~~~~~| pool |~~~~~~~~~| pool |~~~~~~~~~~~~~| …
[all …]
Dbump-allocator.h50 // | Memory Pool
75 * Construct BumpPointer allocator with provided pool
76 * @param pool - pool
78 explicit BumpPointerAllocator(Pool pool, SpaceType typeAllocation, MemStatsType *memStats,
107 * @brief Add an extra memory pool to the allocator.
108 * The memory pool must be located just after the current memory given to this allocator.
109 * @param mem - pointer to the extra memory pool.
110 * @param size - a size of the extra memory pool.
/arkcompiler/runtime_core/static_core/runtime/mem/gc/workers/
Dgc_workers_task_pool.h24 /// @brief Base abstract class for GC workers task pool
33 * @brief Add new GCWorkerTask to gc workers task pool
34 * @param task new gc worker task for pool
37 * @return true if task successfully added to pool, false - otherwise
42 * @brief Add new GCWorkerTask to gc workers task pool by gc task type
43 * @param type type of new gc worker task for pool
46 * @return true if task successfully added to pool, false - otherwise
64 * @brief If gc task pool is not empty then try to get gc workers task from gc task pool
72 * @param task gc worker task for pool
74 * @return true if task successfully added to pool, false - otherwise
[all …]
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_test_suite/coroutines/
DCMakeLists.txt26 # OPTION_SETS_STACKFUL "DEFAULT" "POOL" "MIGRATION_AWAIT"
71 if(option_set STREQUAL "POOL")
72 set(additional_options "--use-coroutine-pool=true")
121 OPTION_SETS_STACKFUL "POOL"
155 OPTION_SETS_STACKFUL "POOL"
163 OPTION_SETS_STACKFUL "DEFAULT" "POOL"
172 OPTION_SETS_STACKFUL "DEFAULT" "POOL"
181 OPTION_SETS_STACKFUL "DEFAULT" "POOL"
189 OPTION_SETS_STACKFUL "POOL"
200 OPTION_SETS_STACKFUL "DEFAULT" "POOL"
[all …]
/arkcompiler/runtime_core/libabckit/tests/stress/
Dstress_test.py18 import multiprocessing.pool
50 with multiprocessing.pool.ThreadPool(stress_common.NPROC) as pool:
51 for result in pool.imap(self.run_single, tests):
77 with multiprocessing.pool.ThreadPool(stress_common.NPROC) as pool:
78 for js_path, abc_path, retcode in pool.imap(self.compile_single,
/arkcompiler/ets_runtime/ecmascript/tests/
Djit_fort_test.cpp73 MemDescPool *pool = new MemDescPool(1, 1); in HWTEST_F_L0() local
74 ASSERT_NE(pool, nullptr); in HWTEST_F_L0()
75 pool->GetDescFromPool(); in HWTEST_F_L0()
80 MemDescPool *pool = new MemDescPool(1, 1); in HWTEST_F_L0() local
81 ASSERT_NE(pool, nullptr); in HWTEST_F_L0()
82 pool->~MemDescPool(); in HWTEST_F_L0()
/arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/mempool/src/
Dmempool.cpp23 void MemPoolCtrler::FreeMemBlocks(const MemPool &pool, MemBlock *fixedMemHead, MemBlock *bigMemHead) in FreeMemBlocks() argument
25 (void)(pool); in FreeMemBlocks()
62 // Allocate a new memory pool and register it in controller
91 MemBlock *MemPoolCtrler::AllocMemBlock(const MemPool &pool, size_t size) in AllocMemBlock() argument
94 return AllocFixMemBlock(pool); in AllocMemBlock()
96 return AllocBigMemBlock(pool, size); in AllocMemBlock()
100 MemBlock *MemPoolCtrler::AllocFixMemBlock(const MemPool &pool) in AllocFixMemBlock() argument
102 (void)(pool); in AllocFixMemBlock()
123 MemBlock *MemPoolCtrler::AllocBigMemBlock(const MemPool &pool, size_t size) const in AllocBigMemBlock() argument
126 (void)(pool); in AllocBigMemBlock()
[all …]
/arkcompiler/runtime_core/static_core/runtime/tests/
Dhumongous_obj_allocator_test.cpp69Pool pool = PoolManager::GetMmapMemPool()->AllocPool(AlignUp(size, PANDA_POOL_ALIGNMENT_IN_BYTES), in AddMemoryPoolToAllocator() local
72 ASSERT(pool.GetSize() >= size); in AddMemoryPoolToAllocator()
73 if (pool.GetMem() == nullptr) { in AddMemoryPoolToAllocator()
74 ASSERT_TRUE(0 && "Can't get a new pool from PoolManager"); in AddMemoryPoolToAllocator()
76 allocatedPoolsByPoolManager_.push_back(pool); in AddMemoryPoolToAllocator()
77 if (!alloc.AddMemoryPool(pool.GetMem(), size)) { 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()
102 std::vector<Pool> allocatedPoolsByPoolManager_;
103 // Mutex, which allows only one thread to add pool to the pool vector
/arkcompiler/ets_runtime/common_components/taskpool/tests/
Dtaskpool_test.cpp80 TaskpoolTest::ScopedTaskpool pool(2); in HWTEST_F_L0() local
81 EXPECT_NE(pool.Get(), nullptr); in HWTEST_F_L0()
82 EXPECT_GT(pool.Get()->GetTotalThreadNum(), 0U); in HWTEST_F_L0()
86 TaskpoolTest::ScopedTaskpool pool(2); in HWTEST_F_L0() local
87 Taskpool* taskpool = pool.Get(); in HWTEST_F_L0()
/arkcompiler/runtime_core/static_core/docs/
Dtask_manager.md36 1. Managing thread pool - `ThreadPool`, `WorkerThread`
46 1. Creation of thread pool with `N` worker threads
47 1. Getting available `WorkerThread` from the pool of available worker threads
48 1. Returning `WorkerThread` back to the pool of available worker threads
53 1. Keeping thread pool
54 1. Distribute threads from pool between consumers in accordance with different policies

12345678