aboutsummaryrefslogtreecommitdiff
path: root/src/protozero/scattered_stream_writer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/protozero/scattered_stream_writer.cc')
-rw-r--r--src/protozero/scattered_stream_writer.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/protozero/scattered_stream_writer.cc b/src/protozero/scattered_stream_writer.cc
index 16dd895c9..3487fb03f 100644
--- a/src/protozero/scattered_stream_writer.cc
+++ b/src/protozero/scattered_stream_writer.cc
@@ -67,6 +67,15 @@ uint8_t* ScatteredStreamWriter::ReserveBytes(size_t size) {
uint8_t* begin = write_ptr_;
write_ptr_ += size;
#if PERFETTO_DCHECK_IS_ON()
+ // In the past, the service had a matching DCHECK in
+ // TraceBuffer::TryPatchChunkContents, which was assuming that service and all
+ // producers are built with matching DCHECK levels. This turned out to be a
+ // source of problems and was removed in b/197340286. This memset is useless
+ // these days and is here only to maintain ABI compatibility between producers
+ // that use a v20+ SDK and older versions of the service that were built in
+ // debug mode. At some point around 2023 it should be safe to remove it.
+ // (running a debug version of traced in production seems a bad idea
+ // regardless).
memset(begin, 0, size);
#endif
return begin;