/arkcompiler/runtime_core/libpandabase/tests/ |
H A D | arena_test.cpp | 16 #include "mem/arena.h" 56 ArenaT *arena = CreateArena<ArenaT>(arena_size); in GetOccupiedAndFreeSizeTestImplementation() local 57 size_t old_free_size = arena->GetFreeSize(); in GetOccupiedAndFreeSizeTestImplementation() 58 ASSERT_TRUE(arena->Alloc(alloc_size) != nullptr); in GetOccupiedAndFreeSizeTestImplementation() 59 ASSERT_TRUE(arena->GetOccupiedSize() == alloc_size); in GetOccupiedAndFreeSizeTestImplementation() 60 ASSERT_TRUE(old_free_size - alloc_size == arena->GetFreeSize()); in GetOccupiedAndFreeSizeTestImplementation() 69 ArenaT *arena = CreateArena<ArenaT>(arena_size); in ResizeAndResetTestImplementation() local 70 ASSERT_TRUE(alloc_size * immTwo <= arena->GetFreeSize()); in ResizeAndResetTestImplementation() 71 void *first_allocation = arena->Alloc(alloc_size); in ResizeAndResetTestImplementation() 72 void *second_allocation = arena in ResizeAndResetTestImplementation() [all...] |
/arkcompiler/runtime_core/static_core/libpandabase/tests/ |
H A D | arena_test.cpp | 16 #include "mem/arena.h" 60 auto *arena = CreateArena<ArenaT>(arenaSize); in GetOccupiedAndFreeSizeTestImplementation() local 61 size_t oldFreeSize = arena->GetFreeSize(); in GetOccupiedAndFreeSizeTestImplementation() 62 ASSERT_TRUE(arena->Alloc(allocSize) != nullptr); in GetOccupiedAndFreeSizeTestImplementation() 63 ASSERT_TRUE(arena->GetOccupiedSize() == allocSize); in GetOccupiedAndFreeSizeTestImplementation() 64 ASSERT_TRUE(oldFreeSize - allocSize == arena->GetFreeSize()); in GetOccupiedAndFreeSizeTestImplementation() 73 auto *arena = CreateArena<ArenaT>(arenaSize); in ResizeAndResetTestImplementation() local 74 ASSERT_TRUE(allocSize * IMM_TWO <= arena->GetFreeSize()); in ResizeAndResetTestImplementation() 75 void *firstAllocation = arena->Alloc(allocSize); in ResizeAndResetTestImplementation() 76 void *secondAllocation = arena in ResizeAndResetTestImplementation() [all...] |
/arkcompiler/runtime_core/libpandabase/mem/ |
H A D | malloc_mem_pool-inl.h | 41 LOG_MALLOC_MEM_POOL(DEBUG) << "Try to get new arena with size " << std::dec << size << " for " in AllocArenaImpl() 57 LOG_MALLOC_MEM_POOL(DEBUG) << "Allocated new arena with size " << std::dec << size_for_buff in AllocArenaImpl() 63 inline void MallocMemPool::FreeArenaImpl(ArenaT *arena) in FreeArenaImpl() argument 65 LOG_MALLOC_MEM_POOL(DEBUG) << "Try to free arena with size " << std::dec << arena->GetSize() in FreeArenaImpl() 66 << " at addr = " << std::hex << arena; in FreeArenaImpl() local 67 arena->~Arena(); in FreeArenaImpl() 68 os::mem::AlignedFree(arena); in FreeArenaImpl() 69 LOG_MALLOC_MEM_POOL(DEBUG) << "Free arena call finished"; in FreeArenaImpl()
|
H A D | arena.h | 44 * \brief Links this Arena to the \param arena 45 * @param arena - Arena which will be linked as next to the current 47 void LinkTo(Arena *arena); 50 * \brief Clear link to the next arena 61 * @return Size of free area in the arena 66 * @return Size of an occupied area in the arena 71 * @return A pointer to the first byte not in the arena 86 * @return A pointer to the raw memory inside arena 110 * \brief Mark all memory after \param mem as free. Check that \param mem is stored inside this arena. 120 * \brief empties arena 180 LinkNext(DoubleLinkedAlignedArena *arena) LinkNext() argument 189 LinkPrev(DoubleLinkedAlignedArena *arena) LinkPrev() argument [all...] |
H A D | pool_manager.cpp | 39 void PoolManager::FreeArena(Arena *arena) in FreeArena() argument 42 return mmap_mem_pool->FreeArenaImpl(arena); in FreeArena() 44 return malloc_mem_pool->FreeArenaImpl(arena); in FreeArena()
|
H A D | arena-inl.h | 20 #include "arena.h" 73 inline void Arena::LinkTo(Arena *arena) in LinkTo() argument 75 LOG(DEBUG, ALLOC) << "Link arena " << this << " to " << arena; in LinkTo() 77 next_ = arena; in LinkTo() 147 LOG(DEBUG, ALLOC) << "Expand arena: Add " << size << " bytes to the arena " << this; in ExpandArena()
|
H A D | mem_pool.h | 73 * Allocates arena with size bytes 75 * @param size - size of buffer in arena in bytes 76 * @param space_type - type of the space which arena allocated for 77 * @param allocator_type - type of the allocator which arena allocated for 79 * @return pointer to allocated arena 82 // because we set up arena at the first bytes of the pool 92 * Frees allocated arena 93 * @tparam ArenaT - arena type 94 * @param arena - pointer to the arena 97 FreeArena(ArenaT *arena) FreeArena() argument [all...] |
H A D | pool_manager.h | 21 #include "arena-inl.h" 35 static void FreeArena(Arena *arena);
|
H A D | malloc_mem_pool.h | 30 void FreeArenaImpl(ArenaT *arena);
|
H A D | mmap_mem_pool-inl.h | 23 #include "mem/arena-inl.h" 184 LOG_MMAP_MEM_POOL(DEBUG) << "Try to get new arena with size " << std::dec << size << " for " in AllocArenaImpl() 189 LOG_MMAP_MEM_POOL(ERROR) << "Failed to allocate new arena" in AllocArenaImpl() 195 LOG_MMAP_MEM_POOL(DEBUG) << "Allocated new arena with size " << std::dec << pool_for_arena.GetSize() in AllocArenaImpl() 202 inline void MmapMemPool::FreeArenaImpl(ArenaT *arena) in FreeArenaImpl() argument 205 size_t size = arena->GetSize(); in FreeArenaImpl() 208 LOG_MMAP_MEM_POOL(DEBUG) << "Try to free arena with size " << std::dec << size << " at addr = " << std::hex in FreeArenaImpl() 209 << arena; in FreeArenaImpl() local 210 FreePoolUnsafe(arena, size); in FreeArenaImpl() 211 LOG_MMAP_MEM_POOL(DEBUG) << "Free arena cal in FreeArenaImpl() [all...] |
H A D | alloc_tracker.cpp | 151 // Write end marker to the current arena in Dump() 157 for (auto &arena : arenas_) { in Dump() 158 uint8_t *ptr = arena.get(); in Dump()
|
H A D | mmap_mem_pool.h | 185 void FreeArenaImpl(ArenaT *arena);
|
/arkcompiler/runtime_core/static_core/libpandabase/mem/ |
H A D | arena.h | 44 * @brief Links this Arena to the @param arena 45 * @param arena - Arena which will be linked as next to the current 47 void LinkTo(Arena *arena); 49 /// @brief Clear link to the next arena 58 /// @return Size of free area in the arena 61 /// @return Size of an occupied area in the arena 64 /// @return A pointer to the first byte not in the arena 73 /// @return A pointer to the raw memory inside arena 95 /// @brief Mark all memory after @param mem as free. Check that @param mem is stored inside this arena. 101 /// @brief empties arena 160 LinkNext(DoubleLinkedAlignedArena *arena) LinkNext() argument 169 LinkPrev(DoubleLinkedAlignedArena *arena) LinkPrev() argument [all...] |
H A D | malloc_mem_pool-inl.h | 42 LOG_MALLOC_MEM_POOL(DEBUG) << "Try to get new arena with size " << std::dec << size << " for " in AllocArenaImpl() 58 LOG_MALLOC_MEM_POOL(DEBUG) << "Allocated new arena with size " << std::dec << sizeForBuff in AllocArenaImpl() 67 inline void MallocMemPool::FreeArenaImpl(ArenaT *arena) in FreeArenaImpl() argument 69 LOG_MALLOC_MEM_POOL(DEBUG) << "Try to free arena with size " << std::dec << arena->GetSize() in FreeArenaImpl() 70 << " at addr = " << std::hex << arena; in FreeArenaImpl() local 71 arena->~Arena(); in FreeArenaImpl() 72 os::mem::AlignedFree(arena); in FreeArenaImpl() 73 LOG_MALLOC_MEM_POOL(DEBUG) << "Free arena call finished"; in FreeArenaImpl()
|
H A D | pool_manager.cpp | 40 void PoolManager::FreeArena(Arena *arena) in FreeArena() argument 43 return mmapMemPool_->template FreeArenaImpl<Arena, OSPagesPolicy::IMMEDIATE_RETURN>(arena); in FreeArena() 45 return mallocMemPool_->template FreeArenaImpl<Arena, OSPagesPolicy::IMMEDIATE_RETURN>(arena); in FreeArena()
|
H A D | arena-inl.h | 20 #include "arena.h" 73 inline void Arena::LinkTo(Arena *arena) in LinkTo() argument 75 LOG(DEBUG, ALLOC) << "Link arena " << this << " to " << arena; in LinkTo() 77 next_ = arena; in LinkTo() 147 LOG(DEBUG, ALLOC) << "Expand arena: Add " << size << " bytes to the arena " << this; in ExpandArena()
|
H A D | pool_manager.h | 20 #include "arena-inl.h" 34 PANDA_PUBLIC_API static void FreeArena(Arena *arena);
|
H A D | malloc_mem_pool.h | 30 void FreeArenaImpl(ArenaT *arena);
|
H A D | mem_pool.h | 83 * Allocates arena with size bytes 86 * @param size - size of buffer in arena in bytes 87 * @param space_type - type of the space which arena allocated for 88 * @param allocator_type - type of the allocator which arena allocated for 90 * @return pointer to allocated arena 93 // because we set up arena at the first bytes of the pool 109 * Frees allocated arena 110 * @tparam ArenaT - arena type 112 * @param arena - pointer to the arena 115 FreeArena(ArenaT *arena) FreeArena() argument [all...] |
H A D | mmap_mem_pool-inl.h | 28 #include "mem/arena-inl.h" 278 LOG_MMAP_MEM_POOL(DEBUG) << "Try to get new arena with size " << std::dec << size << " for " in AllocArenaImpl() 283 LOG_MMAP_MEM_POOL(ERROR) << "Failed to allocate new arena" in AllocArenaImpl() 291 LOG_MMAP_MEM_POOL(DEBUG) << "Allocated new arena with size " << std::dec << poolForArena.GetSize() in AllocArenaImpl() 298 inline void MmapMemPool::FreeArenaImpl(ArenaT *arena) in FreeArenaImpl() argument 301 size_t size = arena->GetSize() + (ToUintPtr(arena->GetMem()) - ToUintPtr(arena)); in FreeArenaImpl() 303 LOG_MMAP_MEM_POOL(DEBUG) << "Try to free arena with size " << std::dec << size << " at addr = " << std::hex in FreeArenaImpl() 304 << arena; in FreeArenaImpl() local [all...] |
H A D | alloc_tracker.cpp | 151 // Write end marker to the current arena in Dump() 157 for (auto &arena : arenas_) { in Dump() 158 uint8_t *ptr = arena.get(); in Dump()
|
/arkcompiler/runtime_core/static_core/runtime/mem/ |
H A D | frame_allocator-inl.h | 53 LOG_FRAME_ALLOCATOR(DEBUG) << "Free arena at addr " << std::hex << lastAllocArena_; in ~FrameAllocator() 66 LOG_FRAME_ALLOCATOR(DEBUG) << "Try to allocate a new arena with size " << arenaSize; in TryAllocateNewArena() 69 LOG_FRAME_ALLOCATOR(DEBUG) << "Couldn't get memory for a new arena"; in TryAllocateNewArena() 77 LOG_FRAME_ALLOCATOR(DEBUG) << "Successfully allocate new arena with addr " << std::hex << newArena; in TryAllocateNewArena() 91 LOG_FRAME_ALLOCATOR(DEBUG) << "Can't allocate a new arena, return nullptr"; in Alloc() 96 LOG_FRAME_ALLOCATOR(DEBUG) << "Can't allocate memory in a totally free arena, change default arenas sizes"; in Alloc() 139 // Try to allocate memory in the current arena: in TryToAllocate() 145 // We don't have enough memory in current arena, try to allocate in the next one: in TryToAllocate() 148 LOG_FRAME_ALLOCATOR(DEBUG) << "TryToPush failed - we don't have a free arena"; in TryToAllocate() 158 LOG_FRAME_ALLOCATOR(DEBUG) << "Couldn't allocate " << size << " bytes of memory in the totally free arena in TryToAllocate() 221 FreeArenaImpl(FramesArena *arena) FreeArenaImpl() argument [all...] |
H A D | frame_allocator.h | 21 #include "libpandabase/mem/arena-inl.h" 29 // Allocate arenas for frames Frames free Return arenas Second allocated arena 83 * @brief Heuristic for arena size increase. 89 * @brief Try to allocate an arena from the memory. 95 * @brief Try to allocate memory for a frame in the current arena or in the next one if it exists. 101 /// @brief Free last_allocated_arena_, i.e., free last arena in the list. 105 * @brief Try to allocate an arena from the memory. 106 * @param size - size of the required arena 112 * @brief Free given arena 113 * @param arena [all...] |
/arkcompiler/runtime_core/static_core/runtime/tests/ |
H A D | bump_allocator_test.cpp | 68 auto arena = new Arena(size, mem); in AllocateArena() local 69 allocatedArenas_.push_back(arena); in AllocateArena() 70 return arena; in AllocateArena()
|
/arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/mempool/src/ |
H A D | mempool.cpp | 91 MemBlock *arena = fixedFreeMemBlocks; in FreeMem() local 93 delete arena; in FreeMem()
|