Home | History | Annotate | Download | only in allocator

Lines Matching refs:RosAlloc

23 #include "rosalloc.h"
33 extern "C" void* art_heap_rosalloc_morecore(RosAlloc* rosalloc, intptr_t increment);
39 size_t RosAlloc::bracketSizes[kNumOfSizeBrackets];
40 size_t RosAlloc::numOfPages[kNumOfSizeBrackets];
41 size_t RosAlloc::numOfSlots[kNumOfSizeBrackets];
42 size_t RosAlloc::headerSizes[kNumOfSizeBrackets];
43 size_t RosAlloc::bulkFreeBitMapOffsets[kNumOfSizeBrackets];
44 size_t RosAlloc::threadLocalFreeBitMapOffsets[kNumOfSizeBrackets];
45 bool RosAlloc::initialized_ = false;
46 size_t RosAlloc::dedicated_full_run_storage_[kPageSize / sizeof(size_t)] = { 0 };
47 RosAlloc::Run* RosAlloc::dedicated_full_run_ =
48 reinterpret_cast<RosAlloc::Run*>(dedicated_full_run_storage_);
50 RosAlloc::RosAlloc(void* base, size_t capacity, size_t max_capacity,
54 lock_("rosalloc global lock", kRosAllocGlobalLock),
55 bulk_free_lock_("rosalloc bulk free lock", kRosAllocBulkFreeLock),
65 VLOG(heap) << "RosAlloc base="
72 StringPrintf("an rosalloc size bracket %d lock", static_cast<int>(i));
80 page_map_mem_map_.reset(MemMap::MapAnonymous("rosalloc page map", NULL, RoundUp(max_num_of_pages, kPageSize),
98 LOG(INFO) << "RosAlloc::RosAlloc() : Inserted run 0x" << std::hex
104 RosAlloc::~RosAlloc() {
110 void* RosAlloc::AllocPages(Thread* self, size_t num_pages, byte page_map_type) {
125 LOG(INFO) << "RosAlloc::AllocPages() : Erased run 0x"
140 LOG(INFO) << "RosAlloc::AllocPages() : Inserted run 0x" << std::hex
199 LOG(INFO) << "RosAlloc::AlloPages() : Grew the heap by inserting run 0x"
206 LOG(INFO) << "RosAlloc::AllocPages() : increased the footprint from "
224 LOG(INFO) << "RosAlloc::AllocPages() : Erased run 0x" << std::hex << reinterpret_cast<intptr_t>(fpr)
237 LOG(INFO) << "RosAlloc::AllocPages() : Inserted run 0x" << std::hex
275 LOG(INFO) << "RosAlloc::AllocPages() : 0x" << std::hex << reinterpret_cast<intptr_t>(res)
284 LOG(INFO) << "RosAlloc::AllocPages() : NULL";
289 size_t RosAlloc::FreePages(Thread* self, void* ptr, bool already_zero) {
349 LOG(INFO) << __PRETTY_FUNCTION__ << "RosAlloc::FreePages() : trying to coalesce a free page run 0x"
360 LOG(INFO) << "RosAlloc::FreePages() : trying to coalesce with a higher free page run 0x"
375 LOG(INFO) << "RosAlloc::FreePages() : (coalesce) Erased run 0x" << std::hex
402 LOG(INFO) << "RosAlloc::FreePages() : trying to coalesce with a lower free page run 0x"
413 LOG(INFO) << "RosAlloc::FreePages() : (coalesce) Erased run 0x" << std::hex
447 LOG(INFO) << "RosAlloc::FreePages() : Inserted run 0x" << std::hex << reinterpret_cast<intptr_t>(fpr)
453 void* RosAlloc::AllocLargeObject(Thread* self, size_t size, size_t* bytes_allocated) {
463 LOG(INFO) << "RosAlloc::AllocLargeObject() : NULL";
470 LOG(INFO) << "RosAlloc::AllocLargeObject() : 0x" << std::hex << reinterpret_cast<intptr_t>(r)
485 size_t RosAlloc::FreeInternal(Thread* self, void* ptr) {
495 LOG(INFO) << "RosAlloc::FreeInternal() : " << std::hex << ptr << ", pm_idx=" << std::dec << pm_idx
530 size_t RosAlloc::Free(Thread* self, void* ptr) {
535 RosAlloc::Run* RosAlloc::AllocRun(Thread* self, size_t idx) {
536 RosAlloc::Run* new_run = nullptr;
570 RosAlloc::Run* RosAlloc::RefillRun(Thread* self, size_t idx) {
586 inline void* RosAlloc::AllocFromCurrentRunUnlocked(Thread* self, size_t idx) {
622 void* RosAlloc::AllocFromRunThreadUnsafe(Thread* self, size_t size, size_t* bytes_allocated) {
641 void* RosAlloc::AllocFromRun(Thread* self, size_t size, size_t* bytes_allocated) {
692 LOG(INFO) << "RosAlloc::AllocFromRun() : Inserted run 0x" << std::hex
721 LOG(INFO) << "RosAlloc::AllocFromRun() thread-local : 0x" << std::hex << reinterpret_cast<intptr_t>(slot_addr)
730 LOG(INFO) << "RosAlloc::AllocFromRun() : 0x" << std::hex << reinterpret_cast<intptr_t>(slot_addr)
741 size_t RosAlloc::FreeFromRun(Thread* self, void* ptr, Run* run) {
753 LOG(INFO) << "RosAlloc::FreeFromRun() : 0x" << std::hex << reinterpret_cast<intptr_t>(ptr);
762 LOG(INFO) << "RosAlloc::FreeFromRun() : Freed a slot in a thread local run 0x" << std::hex
777 LOG(INFO) << "RosAlloc::FreeFromRun() : Erased run 0x" << std::hex
805 RosAlloc::FreeFromRun() : Erased run 0x" << std::hex
812 LOG(INFO) << "RosAlloc::FreeFromRun() : Inserted run 0x" << std::hex
822 std::string RosAlloc::Run::BitMapToStr(uint32_t* bit_map_base, size_t num_vec) {
835 std::string RosAlloc::Run::Dump() {
840 stream << "RosAlloc Run = " << reinterpret_cast<void*>(this)
853 inline void* RosAlloc::Run::AllocSlot() {
875 LOG(INFO) << "RosAlloc::Run::AllocSlot() : 0x" << std::hex << reinterpret_cast<intptr_t>(slot_addr)
891 void RosAlloc::Run::FreeSlot(void* ptr) {
916 LOG(INFO) << "RosAlloc::Run::FreeSlot() : 0x" << std::hex << reinterpret_cast<intptr_t>(ptr)
921 inline bool RosAlloc::Run::MergeThreadLocalFreeBitMapToAllocBitMap(bool* is_all_free_after_out) {
961 inline void RosAlloc::Run::MergeBulkFreeBitMapIntoAllocBitMap() {
978 inline void RosAlloc::Run::UnionBulkFreeBitMapToThreadLocalFreeBitMap() {
994 inline void RosAlloc::Run::MarkThreadLocalFreeBitMap(void* ptr) {
999 inline size_t RosAlloc::Run::MarkBulkFreeBitMap(void* ptr) {
1003 inline size_t RosAlloc::Run::MarkFreeBitMapShared(void* ptr, uint32_t* free_bit_map_base,
1025 LOG(INFO) << "RosAlloc::Run::" << caller_name << "() : 0x" << std::hex
1032 inline uint32_t RosAlloc::Run::GetBitmapLastVectorMask(size_t num_slots, size_t num_vec) {
1040 inline bool RosAlloc::Run::IsAllFree() {
1056 inline bool RosAlloc::Run::IsFull() {
1066 inline bool RosAlloc::Run::IsBulkFreeBitmapClean() {
1077 inline bool RosAlloc::Run::IsThreadLocalFreeBitmapClean() {
1088 inline void RosAlloc::Run::SetAllocBitMapBitsForInvalidSlots() {
1098 inline void RosAlloc::Run::ZeroHeader() {
1103 inline void RosAlloc::Run::ZeroData() {
1109 inline void RosAlloc::Run::FillAllocBitMap() {
1115 void RosAlloc::Run::InspectAllSlots(void (*handler)(void* start, void* end, size_t used_bytes, void* callback_arg),
1146 size_t RosAlloc::BulkFree(Thread* self, void** ptrs, size_t num_ptrs) {
1175 LOG(INFO) << "RosAlloc::BulkFree() : " << std::hex << ptr << ", pm_idx="
1202 LOG(INFO) << "RosAlloc::BulkFree() : " << std::hex << ptr << ", pm_idx="
1254 LOG(INFO) << "RosAlloc::BulkFree() : Freed slot(s) in a thread local run 0x"
1264 LOG(INFO) << "RosAlloc::BulkFree() : Freed slot(s) in a run 0x" << std::hex
1288 LOG(INFO) << "RosAlloc::BulkFree() : Erased run 0x" << std::hex
1300 LOG(INFO) << "RosAlloc::BulkFree() : Erased run 0x" << std::hex
1327 LOG(INFO) << "RosAlloc::BulkFree() : Erased run 0x" << std::hex
1334 LOG(INFO) << "RosAlloc::BulkFree() : Inserted run 0x" << std::hex
1349 std::string RosAlloc::DumpPageMap() {
1351 stream << "RosAlloc PageMap: " << std::endl;
1440 size_t RosAlloc::UsableSize(void* ptr) {
1490 bool RosAlloc::Trim() {
1528 LOG(INFO) << "RosAlloc::Trim() : decreased the footprint from "
1539 void RosAlloc::InspectAll(void (*handler)(void* start, void* end, size_t used_bytes, void* callback_arg),
1628 size_t RosAlloc::Footprint() {
1633 size_t RosAlloc::FootprintLimit() {
1638 void RosAlloc::SetFootprintLimit(size_t new_capacity) {
1649 void RosAlloc::RevokeThreadLocalRuns(Thread* thread) {
1674 void RosAlloc::RevokeRun(Thread* self, size_t idx, Run* run) {
1702 void RosAlloc::RevokeThreadUnsafeCurrentRuns() {
1714 void RosAlloc::RevokeAllThreadLocalRuns() {
1726 void RosAlloc::AssertThreadLocalRunsAreRevoked(Thread* thread) {
1739 void RosAlloc::AssertAllThreadLocalRunsAreRevoked() {
1755 void RosAlloc::Initialize() {
1856 void RosAlloc::BytesAllocatedCallback(void* start, void* end, size_t used_bytes, void* arg) {
1864 void RosAlloc::ObjectsAllocatedCallback(void* start, void* end, size_t used_bytes, void* arg) {
1872 void RosAlloc::Verify() {
1924 << "A rosalloc large object size must be > " << kLargeSizeThreshold;
1926 << "A rosalloc large object size " << obj_size
1995 void RosAlloc::Run::Verify(Thread* self, RosAlloc* rosalloc) {
2022 MutexLock mu(self, *rosalloc->size_bracket_locks_[i]);
2042 MutexLock mu(self, *rosalloc->size_bracket_locks_[i]);
2043 Run* current_run = rosalloc->current_runs_[i];
2058 MutexLock mu(self, rosalloc->lock_);
2059 std::set<Run*>& non_full_runs = rosalloc->non_full_runs_[idx];
2069 std::unordered_set<Run*, hash_run, eq_run>& full_runs = rosalloc->full_runs_[idx];
2103 size_t RosAlloc::ReleasePages() {
2104 VLOG(heap) << "RosAlloc::ReleasePages()";
2159 size_t RosAlloc::ReleasePageRange(byte* start, byte* end) {
2188 void RosAlloc::LogFragmentationAllocFailure(std::ostream& os, size_t failed_alloc_bytes) {