Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::ScopedHeapDelta Class Reference

Brackets one stage of the frame and attributes the allocator movement across it. More...

#include "donner/base/MemoryAttribution.h"

Public Member Functions

 ScopedHeapDelta (MemoryStage stage)
 Open a stage interval attributed to stage.
 ~ScopedHeapDelta ()
 Close the interval and fold its net allocator movement into the totals.
 ScopedHeapDelta (const ScopedHeapDelta &)=delete
ScopedHeapDeltaoperator= (const ScopedHeapDelta &)=delete
 ScopedHeapDelta (ScopedHeapDelta &&)=delete
ScopedHeapDeltaoperator= (ScopedHeapDelta &&)=delete

Detailed Description

Brackets one stage of the frame and attributes the allocator movement across it.

Nesting is allowed but double-counts the inner interval into both stages, so bracket disjoint stages when the totals are meant to add up. The measurement is a mallinfo call on entry and exit; that walks the allocator's bins, so it belongs at frame-stage granularity and never inside a loop.

The bracket also pushes the stage's AllocTag, so every large block allocated inside it is attributed to the stage without a second guard at the call site. A finer ScopedAllocTag nested inside still wins, because tags are innermost-first.


The documentation for this class was generated from the following file: