mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 13:21:28 +00:00

The main thread is the busiest, so it benefits the most from having its own chunked buffer. This removes one allocation when capturing a marker stack on the main thread of each process. That buffer is allocated when the first profiler starts, and is destroyed when the last profiler stops. Note: Further improvements are possible (e.g.: Pool of pre-allocated buffers, attempting to use a stack-based buffer, etc.), but they are more complex and will require more work in future bugs. Differential Revision: https://phabricator.services.mozilla.com/D133725