View source code
							
							
						
								Display the source code in std/experimental/allocator/building_blocks/stats_collector.d from which this
								page was generated on github.
							
						
							Report a bug
							
						
								If you spot a problem with this page, click here to create a
								Bugzilla issue.
							
						
							
								Improve this page
							
							
					
								Quickly fork, edit online, and submit a pull request for this page.
								Requires a signed-in GitHub account. This works well for small changes.
								If you'd like to make larger changes you may want to consider using
								local clone.
							
						Struct std.experimental.allocator.building_blocks.stats_collector.StatsCollector
Allocator that collects extra data about allocations. Since each piece of
information adds size and time overhead, statistics can be individually enabled
or disabled through compile-time flags.
						
				struct StatsCollector(Allocator, ulong flags = Options
				All stats of the form numXxx record counts of events occurring, such as
calls to functions and specific results. The stats of the form bytesXxx
collect cumulative sizes.
In addition, the data callerSize, callerModule, callerFile, callerLine, and callerTime is associated with each specific allocation.
This data prefixes each allocation.
Fields
| Name | Type | Description | 
|---|---|---|
| parent | Allocator | The parent allocator is publicly accessible either as a direct member if it
    holds state, or as an alias to Allocatorotherwise. One may use
    it for making calls that won't count toward statistics collection. | 
Properties
| Name | Type | Description | 
|---|---|---|
| bytesAllocated[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| bytesContracted[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| bytesExpanded[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| bytesHighTide[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| bytesMoved[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| bytesNotMoved[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| bytesSlack[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| bytesUsed[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| numAlignedAllocate[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| numAlignedAllocateOk[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| numAllocate[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| numAllocateOK[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| numDeallocate[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| numDeallocateAll[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| numExpand[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| numExpandOK[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| numOwns[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| numReallocate[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| numReallocateInPlace[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
| numReallocateOK[get] | ulong | Read-only properties enabled by the homonym flagschosen by the
        user. | 
Methods
| Name | Description | 
|---|---|
| alignedAllocate(n, a) | Forwards to parent. Affects per instance:numAlignedAllocate,bytesUsed,bytesAllocated,bytesSlack,numAlignedAllocateOk,
    andbytesHighTide. Affects per call:numAlignedAllocate,numAlignedAllocateOk,
    andbytesAllocated. | 
| allocate(n) | Forwards to parent. Affects per instance:numAllocate,bytesUsed,bytesAllocated,bytesSlack,numAllocateOK,
    andbytesHighTide. Affects per call:numAllocate,    numAllocateOK, andbytesAllocated. | 
| byFileLine() | Defined if perCallFlagsis nonzero. Iterates all monitored
        file/line instances. The order of iteration is not meaningful (items
        are inserted at the front of a list upon the first call), so
        preprocessing the statistics after collection might be appropriate. | 
| deallocate(b) | Defined whether or not Allocatoris defined. Affects
    per instance:numDeallocate,bytesUsed, andbytesSlack.
    Affects per call:numDeallocateandbytesContracted. | 
| deallocateAll() | Defined only if Allocatoris defined. Affects
        per instance and per callnumDeallocateAll. | 
| empty() | Defined only if Optionsis defined. ReturnsbytesUsed ==
    0. | 
| expand(b, delta) | Defined whether or not Allocatoris defined. Affects
    per instance:numExpand,numExpandOK,bytesExpanded,bytesSlack,bytesAllocated, andbytesUsed. Affects per call:numExpand,numExpandOK,bytesExpanded, andbytesAllocated. | 
| owns(b) | Increments numOwns(per instance and and per call) and forwards to    parent. | 
| reallocate(b, s) | Defined whether or not Allocatoris defined. Affects
    per instance:numReallocate,numReallocateOK,    numReallocateInPlace,bytesNotMoved,bytesAllocated,    bytesSlack,bytesExpanded, andbytesContracted. Affects per call:numReallocate,numReallocateOK,numReallocateInPlace,bytesNotMoved,bytesExpanded,bytesContracted, andbytesMoved. | 
| reportPerCallStatistics(output) | Defined if perCallFlagsis nonzero. Outputs (e.g. to aFile)
        a simple report of the collected per-call statistics. | 
| reportStatistics(output) | Reports per instance statistics to output(e.g.stdout). The
    format is simple: one kind and value per line, separated by a colon, e.g.bytesAllocated:7395404 | 
Inner structs
| Name | Description | 
|---|---|
| PerCallStatistics | Defined if perCallFlagsis nonzero. | 
Aliases
| Name | Description | 
|---|---|
| alignment | Alignment offered is equal to Allocator. | 
Example
import stdAuthors
License
					Copyright © 1999-2024 by the D Language Foundation | Page generated by ddox.