InuseMemory is a memory profiler option which enables tracking of allocated and freed objects to generate snapshots of the current state of a program memory.
(enable bool)
| 40 | // and freed objects to generate snapshots of the current state of a program |
| 41 | // memory. |
| 42 | func InuseMemory(enable bool) MemoryProfilerOption { |
| 43 | return func(p *MemoryProfiler) { |
| 44 | if enable { |
| 45 | p.inuse = make(map[uint32]memoryAllocation) |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | type memoryAllocation struct { |
| 51 | *stackCounter |