summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCoredump/Reader.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-22 00:33:43 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-22 00:40:07 +0200
commit784ab75d2d19ef691f9a0a3add2ba84b73db4317 (patch)
treea96c8e46860070d93fc762f82ac909b42c224be6 /Userland/Libraries/LibCoredump/Reader.h
parent1da8faebf55a9937fa1fd37478ab21a33716ebcc (diff)
downloadserenity-784ab75d2d19ef691f9a0a3add2ba84b73db4317.zip
LibCoredump: Don't copy uncompressed coredumps into a ByteBuffer
This was completely unnecessary and accounted for 6% of the total time spent when loading a WebContent coredump into CrashReporter.
Diffstat (limited to 'Userland/Libraries/LibCoredump/Reader.h')
-rw-r--r--Userland/Libraries/LibCoredump/Reader.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCoredump/Reader.h b/Userland/Libraries/LibCoredump/Reader.h
index 1f7e776dc4..71b52d248c 100644
--- a/Userland/Libraries/LibCoredump/Reader.h
+++ b/Userland/Libraries/LibCoredump/Reader.h
@@ -51,7 +51,9 @@ public:
HashMap<String, String> metadata() const;
private:
- Reader(ByteBuffer);
+ explicit Reader(ReadonlyBytes);
+ explicit Reader(ByteBuffer);
+ explicit Reader(NonnullRefPtr<MappedFile>);
static Optional<ByteBuffer> decompress_coredump(const ReadonlyBytes&);
@@ -75,7 +77,14 @@ private:
// as getters with the appropriate (non-JsonValue) types.
const JsonObject process_info() const;
+ // For uncompressed coredumps, we keep the MappedFile
+ RefPtr<MappedFile> m_mapped_file;
+
+ // For compressed coredumps, we decompress them into a ByteBuffer
ByteBuffer m_coredump_buffer;
+
+ ReadonlyBytes m_coredump_bytes;
+
ELF::Image m_coredump_image;
ssize_t m_notes_segment_index { -1 };
};