Bug 1429904 - Remove ProfileBuffer::Reset(). r?njn
MozReview-Commit-ID: AzIyYByoesS
--- a/tools/profiler/core/ProfileBuffer.cpp
+++ b/tools/profiler/core/ProfileBuffer.cpp
@@ -105,27 +105,16 @@ ProfileBuffer::DeleteExpiredStoredMarker
// Delete markers of samples that have been overwritten due to circular
// buffer wraparound.
while (mStoredMarkers.peek() &&
mStoredMarkers.peek()->HasExpired(mRangeStart)) {
delete mStoredMarkers.popHead();
}
}
-void
-ProfileBuffer::Reset()
-{
- // Empty the buffer (make sure that mRangeEnd - mRangeStart == 0) and
- // increase the positions by twice the buffer size for good measure.
- // This method isn't really intended to stay around for long; the only user
- // wants to flush only one thread's data and ends up accidentally flushing
- // the whole buffer which holds data for all threads, see bug 1429904.
- mRangeStart = mRangeEnd = mRangeEnd + 2 * mEntrySize;
-}
-
size_t
ProfileBuffer::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
size_t n = aMallocSizeOf(this);
n += aMallocSizeOf(mEntries.get());
// Measurement of the following members may be added later if DMD finds it
// is worthwhile:
--- a/tools/profiler/core/ProfileBuffer.h
+++ b/tools/profiler/core/ProfileBuffer.h
@@ -81,19 +81,18 @@ public:
// Mutate |aLastSample| to point to the newly inserted sample.
// Returns whether duplication was successful.
bool DuplicateLastSample(int aThreadId,
const mozilla::TimeStamp& aProcessStartTime,
mozilla::Maybe<uint64_t>& aLastSample);
void AddStoredMarker(ProfilerMarker* aStoredMarker);
- // The following two methods are not signal safe! They delete markers.
+ // The following method is not signal safe!
void DeleteExpiredStoredMarkers();
- void Reset();
// Access an entry in the buffer.
ProfileBufferEntry& GetEntry(uint64_t aPosition) const
{
return mEntries[aPosition & mEntryIndexMask];
}
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;