Skip to content
  • siggi's avatar
    Rename ScopedThreadHeapUsage to ThreadHeapUsageTracker and change interface. · 07856a7b
    siggi authored
    This is broken out from https://codereview.chromium.org/2386123003/, and the interface changes are influenced by actual usage.
    
    The interface is changed to use explicit Start/Stop, instead of implicitly starting and stopping on creation/destruction. This is necessary to support exclusive scopes, which is how base/tracked_objects.h does task execution time measurement. Unfortunately a Scoped* abstraction can't support exclusive scopes, as here must always be a gap from reading the current state to when the Scoped* instance goes out of scope. Any heap activity in this gap will be lost from measurement, and will neither tally to the current nor the outer scope.
    
    Initialization is also changed, such that TLS is initialized as heap tracking is enabled. It is now allowed to create ThreadHeapTracker instances without any initialization, though it's not allowed to Start() them.
    
    BUG=644385
    
    Review-Url: https://codereview.chromium.org/2427503003
    Cr-Commit-Position: refs/heads/master@{#425997}
    07856a7b