Home
last modified time | relevance | path

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

1234567

/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.h38 inline Pool MmapPoolMap::PopFreePool(size_t size) in PopFreePool()
55 Pool pool(size, elementMem); in PopFreePool()
58 Pool newPool(elementSize - size, ToVoidPtr(ToUintPtr(elementMem) + size)); in PopFreePool()
67 uintptr_t poolStart = ToUintPtr(pool.GetMem()); in PopFreePool()
68 size_t poolSize = pool.GetSize(); in PopFreePool()
69 …MMAP_MEM_POOL(DEBUG) << "Return pages to OS from Free Pool to get zeroed memory: start = " << pool in PopFreePool()
73 return pool; in PopFreePool()
77 inline std::pair<size_t, OSPagesPolicy> MmapPoolMap::PushFreePool(Pool pool) in PushFreePool() argument
80 auto mmapPoolElement = poolMap_.find(pool.GetMem()); in PushFreePool()
82 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/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/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.cpp49 void FreePoolWithPolicy(MmapMemPool *memPool, OSPagesPolicy policy, Pool &pool) in FreePoolWithPolicy() argument
52 memPool->template FreePool<OSPagesPolicy::NO_RETURN>(pool.GetMem(), pool.GetSize()); in FreePoolWithPolicy()
54 … memPool->template FreePool<OSPagesPolicy::IMMEDIATE_RETURN>(pool.GetMem(), pool.GetSize()); in FreePoolWithPolicy()
65 std::array<Pool, POOL_COUNT> pools {{NULLPOOL, NULLPOOL, NULLPOOL}}; in ReturnedToOsTest()
66 Pool fourthPool = NULLPOOL; in ReturnedToOsTest()
207Pool poolWithAllocAddr = memPool->AllocPool(POOL_SIZE, SpaceType::SPACE_TYPE_OBJECT, ALLOC_TYPE, a… in TEST_F()
208Pool poolWithoutAllocAddr = memPool->AllocPool(POOL_SIZE, SpaceType::SPACE_TYPE_OBJECT, ALLOC_TYPE… in TEST_F()
236Pool objectPool = memPool->AllocPool(1_GB, SpaceType::SPACE_TYPE_OBJECT, AllocatorType::BUMP_ALLOC… in TEST_F()
237Pool internalPool = memPool->AllocPool(1_GB, SpaceType::SPACE_TYPE_COMPILER, AllocatorType::BUMP_A… in TEST_F()
238Pool codePool = memPool->AllocPool(1_GB, SpaceType::SPACE_TYPE_CODE, AllocatorType::BUMP_ALLOCATOR… in TEST_F()
[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
177 …// If we have too big pool for allocation then after space increasing we can have not memory for t…
178 // so we save pool size and increase heap space to allocate such pool
193 …[[nodiscard]] Pool TryAllocPoolBase(size_t poolSize, SpaceType spaceType, AllocatorType allocatorT…
251 // | shared pool (use for G1-GC) young, tenured and free pools …
256 // |~~~| | |~~~|~~~| |~~~~~| 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.txt25 # OPTION_SETS_STACKFUL "DEFAULT" "JS" "POOL" "JS_POOL"
68 elseif(option_set STREQUAL "POOL")
69 set(additional_options "--use-coroutine-pool=true")
71 set(additional_options "--coroutine-js-mode=true" "--use-coroutine-pool=true")
118 OPTION_SETS_STACKFUL "DEFAULT" "JS" "POOL"
151 OPTION_SETS_STACKFUL "DEFAULT" "JS" "POOL" "JS_POOL"
160 OPTION_SETS_STACKFUL "DEFAULT" "JS" "POOL" "JS_POOL"
169 OPTION_SETS_STACKFUL "DEFAULT" "JS" "POOL" "JS_POOL"
186 OPTION_SETS_STACKFUL "POOL"
195 OPTION_SETS_STACKFUL "DEFAULT" "JS" "POOL" "JS_POOL"
[all …]
/arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/mempool/src/
Dmempool.cpp30 void MemPoolCtrler::FreeMemBlocks(const MemPool &pool, MemBlock *fixedMemHead, MemBlock *bigMemHead) in FreeMemBlocks() argument
32 (void)(pool); in FreeMemBlocks()
70 // Allocate a new memory pool and register it in controller
101 MemBlock *MemPoolCtrler::AllocMemBlock(const MemPool &pool, size_t size) in AllocMemBlock() argument
104 return AllocFixMemBlock(pool); in AllocMemBlock()
106 return AllocBigMemBlock(pool, size); in AllocMemBlock()
110 MemBlock *MemPoolCtrler::AllocFixMemBlock(const MemPool &pool) in AllocFixMemBlock() argument
112 (void)(pool); in AllocFixMemBlock()
134 MemBlock *MemPoolCtrler::AllocBigMemBlock(const MemPool &pool, size_t size) const in AllocBigMemBlock() argument
137 (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/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
/arkcompiler/ets_runtime/ecmascript/tests/
Decma_string_table_test.cpp27 * @tc.desc: Write empty string emptyStr to the Intern pool and takes the hash code as its index.
44 …btain EcmaString string from utf8 encoded data. If the string already exists in the detention pool,
45 … it will be returned directly. If not, it will be added to the detention pool and then returned.
65 …tain EcmaString string from utf16 encoded data. If the string already exists in the detention pool,
66 … it will be returned directly. If not, it will be added to the detention pool and then returned.
87 …tain EcmaString string from another EcmaString. If the string already exists in the detention pool,
88 … it will be returned directly. If not, it will be added to the detention pool and then returned.
/arkcompiler/toolchain/build/toolchain/
DBUILD.gn17 # Pool for non goma tasks.
26 pool("link_pool") {
30 pool("action_pool") {
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_test_suite/containers/
DCMakeLists.txt25 # OPTION_SETS_STACKFUL "DEFAULT" "JS" "POOL" "JS_POOL"
62 elseif(option_set STREQUAL "POOL")
63 set(additional_options "--use-coroutine-pool=true")
65 set(additional_options "--coroutine-js-mode=true" "--use-coroutine-pool=true")
86 OPTION_SETS_STACKFUL "DEFAULT" "JS" "POOL"

1234567