Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43187fe0 authored by Eric Miao's avatar Eric Miao Committed by Android (Google) Code Review
Browse files

Merge "Fix inconsistent tracing of bitmap count/memory" into main

parents 2ab2eebf 1f50d0aa
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -582,20 +582,22 @@ size_t Bitmap::mTotalBitmapBytes = 0;
size_t Bitmap::mTotalBitmapCount = 0;

void Bitmap::traceBitmapCreate() {
    if (ATRACE_ENABLED()) {
    size_t bytes = getAllocationByteCount();
    std::lock_guard lock{mLock};
        mTotalBitmapBytes += getAllocationByteCount();
    mTotalBitmapBytes += bytes;
    mTotalBitmapCount++;
    if (ATRACE_ENABLED()) {
        ATRACE_INT64("Bitmap Memory", mTotalBitmapBytes);
        ATRACE_INT64("Bitmap Count", mTotalBitmapCount);
    }
}

void Bitmap::traceBitmapDelete() {
    if (ATRACE_ENABLED()) {
    size_t bytes = getAllocationByteCount();
    std::lock_guard lock{mLock};
    mTotalBitmapBytes -= getAllocationByteCount();
    mTotalBitmapCount--;
    if (ATRACE_ENABLED()) {
        ATRACE_INT64("Bitmap Memory", mTotalBitmapBytes);
        ATRACE_INT64("Bitmap Count", mTotalBitmapCount);
    }