| 784 | |
| 785 | #ifdef BF32 |
| 786 | static tcmalloc_obj::Span* TCGetSpanAt(void* addr) |
| 787 | { |
| 788 | int checkPageId = (int)((uintptr)addr >> kPageShift); |
| 789 | int checkRootIdx = checkPageId >> PageHeap::PageMap::LEAF_BITS; |
| 790 | int checkLeafIdx = checkPageId & (PageHeap::PageMap::LEAF_LENGTH - 1); |
| 791 | |
| 792 | PageHeap::PageMap::Leaf* rootLeaf = Static::pageheap()->pagemap_.root_[checkRootIdx]; |
| 793 | if (rootLeaf == NULL) |
| 794 | return NULL; |
| 795 | auto span = (tcmalloc_obj::Span*)rootLeaf->values[checkLeafIdx]; |
| 796 | // intptr pageSize = (intptr)1 << kPageShift; |
| 797 | // int spanSize = pageSize * span->length; |
| 798 | // void* spanStart = (void*)((intptr)span->start << kPageShift); |
| 799 | // void* spanEnd = (void*)((intptr)spanStart + spanSize); |
| 800 | // if ((addr >= spanStart) && (addr < spanEnd)) |
| 801 | // return span; |
| 802 | return span; |
| 803 | } |
| 804 | #else |
| 805 | static tcmalloc_obj::Span* TCGetSpanAt(void* addr) |
| 806 | { |
no outgoing calls
no test coverage detected