|
|
Donner SVG 0.8.0-pre
SVG editor and embeddable C++20 engine.
|
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 | |
| ScopedHeapDelta & | operator= (const ScopedHeapDelta &)=delete |
| ScopedHeapDelta (ScopedHeapDelta &&)=delete | |
| ScopedHeapDelta & | operator= (ScopedHeapDelta &&)=delete |
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.