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

Commit 4f217ce2 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" am: 8fc7c37c

am: 05a255c8

Change-Id: I4d1865fb6feccaa656e334dc5be4f1b041e7f562
parents 03babeec 05a255c8
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -61,9 +61,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;
    }
@@ -73,7 +73,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
@@ -49,7 +49,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();