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

Commit 0d4bd95f authored by Tapani Pälli's avatar Tapani Pälli Committed by android-build-merger
Browse files

Merge "libui: use uint64_t in dump and getTotalSize to avoid overflow issues"...

Merge "libui: use uint64_t in dump and getTotalSize to avoid overflow issues" am: 8fc7c37c am: 05a255c8
am: 4f217ce2

Change-Id: I6804e5c4d9130cb64d50bcdf811d5100687a7ed8
parents 896bcfce 4f217ce2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -69,9 +69,9 @@ GraphicBufferAllocator::GraphicBufferAllocator() : mMapper(GraphicBufferMapper::

GraphicBufferAllocator::~GraphicBufferAllocator() {}

size_t GraphicBufferAllocator::getTotalSize() const {
uint64_t GraphicBufferAllocator::getTotalSize() const {
    Mutex::Autolock _l(sLock);
    size_t total = 0;
    uint64_t total = 0;
    for (size_t i = 0; i < sAllocList.size(); ++i) {
        total += sAllocList.valueAt(i).size;
    }
@@ -81,7 +81,7 @@ size_t GraphicBufferAllocator::getTotalSize() const {
void GraphicBufferAllocator::dump(std::string& result) const {
    Mutex::Autolock _l(sLock);
    KeyedVector<buffer_handle_t, alloc_rec_t>& list(sAllocList);
    size_t total = 0;
    uint64_t total = 0;
    result.append("Allocated buffers:\n");
    const size_t c = list.size();
    for (size_t i=0 ; i<c ; i++) {
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ public:

    status_t free(buffer_handle_t handle);

    size_t getTotalSize() const;
    uint64_t getTotalSize() const;

    void dump(std::string& res) const;
    static void dumpToSystemLog();