| 834 | int gMarkTargetMutatorCount = 0; |
| 835 | |
| 836 | int BFGetObjectSize(bf::System::Object* obj) |
| 837 | { |
| 838 | // auto span = TCGetSpanAt(obj); |
| 839 | // int elementSize = Static::sizemap()->ByteSizeForClass(span->sizeclass); |
| 840 | // if (elementSize != 0) |
| 841 | // return elementSize; |
| 842 | // intptr pageSize = (intptr)1 << kPageShift; |
| 843 | // int spanSize = pageSize * span->length; |
| 844 | // return spanSize; |
| 845 | |
| 846 | const PageID p = reinterpret_cast<uintptr_t>(obj) >> kPageShift; |
| 847 | size_t cl = Static::pageheap()->GetSizeClassIfCached(p); |
| 848 | int allocSize = 0; |
| 849 | if (cl == 0) |
| 850 | { |
| 851 | auto span = Static::pageheap()->GetDescriptor(p); |
| 852 | if (span != NULL) |
| 853 | { |
| 854 | cl = span->sizeclass; |
| 855 | if (cl == 0) |
| 856 | { |
| 857 | allocSize = span->length << kPageShift; |
| 858 | } |
| 859 | } |
| 860 | } |
| 861 | if (cl != 0) |
| 862 | allocSize = Static::sizemap()->class_to_size(cl); |
| 863 | return allocSize; |
| 864 | } |
| 865 | |
| 866 | |
| 867 |
no test coverage detected