gecko-dev/mozglue/baseprofiler/public
Gerald Squelart 16dbd4f365 Bug 1582992 - Removed unneded BlocksRingBuffer's entry destructor, and ProfilerBuffer's JS::AutoSuppressGCAnalysis - r=gregtatum
`BlocksRingBuffer` had an "entry destructor" to make it a more generic
container, and it was useful during early prototyping of the new profiler
storage (so that we could store owning pointers).
But this entry destructor is stored in an `std::function`, which gets marked as
a potential GC caller by the js rooting hazard analyzer; and as this bug found,
it's not obvious where to place `JS::AutoSuppressGCAnalysis`, because profiler
entries (including stacks) could be added on one thread while GC happens
elsewhere, which triggers the embedded `AutoAssertNoGC` check.

Since we don't actually use the entry destructor facility in the profiler, it's
easier to just get rid of it. As a bonus, it's a small optimization.
Tests that were using an entry destructor now use the `State` instead, to verify
that entries are pushed and cleared as expected.

If needed in the future outside of the profiler, `BlocksRingBuffer` could again
include an entry destructor, but it would have to be through templating, so that
the class used in the profiler wouldn't contain an `std::function`.

Differential Revision: https://phabricator.services.mozilla.com/D46738

--HG--
extra : moz-landing-system : lando
2019-09-23 20:50:20 +00:00
..
BaseProfileJSONWriter.h Bug 1492121 - Enclosing BaseProfiler in namespace mozilla::baseprofiler - r=njn 2019-06-06 06:20:03 +00:00
BaseProfiler.h Bug 1578329 - profiler_can_accept_markers(), don't store markers when paused - r=gregtatum 2019-09-18 01:21:50 +00:00
BaseProfilerCounts.h Bug 1492121 - Enclosing BaseProfiler in namespace mozilla::baseprofiler - r=njn 2019-06-06 06:20:03 +00:00
BaseProfilerDetail.h Bug 1580091 - BaseProfilerMaybeMutex and BaseProfilerMaybeAutoLock - r=gregtatum 2019-09-18 01:19:06 +00:00
BaseProfilerMarkerPayload.h Bug 1576555 - Don't store temporary ProfilerMarkerPayloads in UniquePtrs - r=gregtatum 2019-09-18 01:21:02 +00:00
BaseProfilerSharedLibraries.h Bug 1492121 - All necessary changes to make baseprofiler build - r=njn 2019-06-06 06:17:49 +00:00
BaseProfilingCategory.h Bug 1492121 - Enclosing BaseProfiler in namespace mozilla::baseprofiler - r=njn 2019-06-06 06:20:03 +00:00
BaseProfilingStack.h Bug 1492121 - Enclosing BaseProfiler in namespace mozilla::baseprofiler - r=njn 2019-06-06 06:20:03 +00:00
BlocksRingBuffer.h Bug 1582992 - Removed unneded BlocksRingBuffer's entry destructor, and ProfilerBuffer's JS::AutoSuppressGCAnalysis - r=gregtatum 2019-09-23 20:50:20 +00:00
leb128iterator.h Bug 1519636 - Ride along: Move to the unix CR type r=Ehsan 2019-07-16 07:34:18 +00:00
ModuloBuffer.h Bug 1581049 - ModuloBuffer::Iterator::ReadInto(ModuloBuffer::Iterator&) - r=gregtatum 2019-09-18 01:22:30 +00:00
PowerOfTwo.h Bug 1552063 - PowerOfTwo, PowerOfTwoMask - r=gregtatum 2019-06-28 07:12:54 +00:00