зеркало из https://github.com/mozilla/gecko-dev.git
16dbd4f365
`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 |
||
---|---|---|
.. | ||
core | ||
lul | ||
public | ||
moz.build |