From 48e9a43dc47aab0627ea44fcb5adfa6af37eaff0 Mon Sep 17 00:00:00 2001 From: "Thinker K.F. Li" Date: Fri, 10 Mar 2017 02:35:00 +0100 Subject: [PATCH] Bug 1331173 - Increase header segment capacity for TaskTracer. r=billm --HG-- extra : rebase_source : 3cc829ac53c520896d3f28ddf4a8e27a6eac6fc1 --- ipc/chromium/src/base/pickle.cc | 7 +++++++ mfbt/BufferList.h | 1 + 2 files changed, 8 insertions(+) diff --git a/ipc/chromium/src/base/pickle.cc b/ipc/chromium/src/base/pickle.cc index 6e6a9804b182..cf30bd2e51eb 100644 --- a/ipc/chromium/src/base/pickle.cc +++ b/ipc/chromium/src/base/pickle.cc @@ -24,7 +24,14 @@ static_assert(MOZ_ALIGNOF(Pickle::memberAlignmentType) >= MOZ_ALIGNOF(uint32_t), "Insufficient alignment"); +#ifndef MOZ_TASK_TRACER static const uint32_t kHeaderSegmentCapacity = 64; +#else +// TaskTracer would add extra fields to the header to carry task ID and +// other information. +// \see class Message::HeaderTaskTracer +static const uint32_t kHeaderSegmentCapacity = 128; +#endif static const uint32_t kDefaultSegmentCapacity = 4096; diff --git a/mfbt/BufferList.h b/mfbt/BufferList.h index 42aea12dbc05..2bb9bb7e01d8 100644 --- a/mfbt/BufferList.h +++ b/mfbt/BufferList.h @@ -316,6 +316,7 @@ private: void* AllocateSegment(size_t aSize, size_t aCapacity) { MOZ_RELEASE_ASSERT(mOwning); + MOZ_ASSERT(aSize <= aCapacity); char* data = this->template pod_malloc(aCapacity); if (!data) {