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

Commit d0e7e801 authored by Eric Laurent's avatar Eric Laurent Committed by Gerrit Code Review
Browse files

Merge "Do partial reads in MemoryLeakTrackUtil"

parents 96a7b5a9 6d39eb9d
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ struct MyString8 {
    }

    void append(const char *s) {
        strcat(mPtr, s);
        strncat(mPtr, s, MAX_SIZE - size() - 1);
    }

    const char *string() const {
@@ -60,6 +60,10 @@ struct MyString8 {
        return strlen(mPtr);
    }

    void clear() {
        *mPtr = '\0';
    }

private:
    char *mPtr;

@@ -139,6 +143,9 @@ void dumpMemoryAddresses(int fd)
            }
        } while (moved);

        write(fd, result.string(), result.size());
        result.clear();

        for (size_t i = 0; i < count; i++) {
            AllocEntry *e = &entries[i];

@@ -152,13 +159,14 @@ void dumpMemoryAddresses(int fd)
                result.append(buffer);
            }
            result.append("\n");

            write(fd, result.string(), result.size());
            result.clear();
        }

        delete[] entries;
        free_malloc_leak_info(info);
    }

    write(fd, result.string(), result.size());
}

#else