From cad62051cacba5a9b9b70dadf902b4a4a2b58cf2 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Fri, 11 Dec 2015 21:17:14 +0100 Subject: [PATCH] Add version to heaptrack data files. --- accumulatedtracedata.cpp | 2 ++ libheaptrack.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/accumulatedtracedata.cpp b/accumulatedtracedata.cpp index c95b776..ba72944 100644 --- a/accumulatedtracedata.cpp +++ b/accumulatedtracedata.cpp @@ -287,6 +287,8 @@ bool AccumulatedTraceData::read(istream& in) leaked = 0; peak = 0; fromAttached = true; + } else if (reader.mode() == 'v') { + // the version, we ignore it for now } else { cerr << "failed to parse line: " << reader.line() << endl; } diff --git a/libheaptrack.cpp b/libheaptrack.cpp index c8365fd..dd1ad5c 100644 --- a/libheaptrack.cpp +++ b/libheaptrack.cpp @@ -110,6 +110,11 @@ struct RecursionGuard thread_local bool RecursionGuard::isActive = false; +void writeVersion(FILE* out) +{ + fprintf(out, "v %x\n", HEAPTRACK_VERSION); +} + void writeExe(FILE* out) { const int BUF_SIZE = 1023; @@ -243,6 +248,7 @@ public: return; } + writeVersion(out); writeExe(out); writeCommandLine(out); -- 2.7.4