MCPcopy Create free account
hub / github.com/dispatchrun/wzprof / newMemoryProfiler

Function newMemoryProfiler

mem.go:57–67  ·  view source on GitHub ↗

newMemoryProfiler constructs a new instance of MemoryProfiler using the given time function to record the profile execution time.

(p *Profiling, options ...MemoryProfilerOption)

Source from the content-addressed store, hash-verified

55// newMemoryProfiler constructs a new instance of MemoryProfiler using the given
56// time function to record the profile execution time.
57func newMemoryProfiler(p *Profiling, options ...MemoryProfilerOption) *MemoryProfiler {
58 m := &MemoryProfiler{
59 p: p,
60 alloc: make(stackCounterMap),
61 start: time.Now(),
62 }
63 for _, opt := range options {
64 opt(m)
65 }
66 return m
67}
68
69// NewProfile takes a snapshot of the current memory allocation state and builds
70// a profile representing the state of the program memory.

Callers 1

MemoryProfilerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected