MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / allocBytes

Function allocBytes

consistent/consistent_test.go:761–768  ·  view source on GitHub ↗

allocBytes returns the number of bytes allocated by invoking f.

(f func())

Source from the content-addressed store, hash-verified

759
760// allocBytes returns the number of bytes allocated by invoking f.
761func allocBytes(f func()) uint64 {
762 var stats runtime.MemStats
763 runtime.ReadMemStats(&stats)
764 t := stats.TotalAlloc
765 f()
766 runtime.ReadMemStats(&stats)
767 return stats.TotalAlloc - t
768}
769
770func mallocNum(f func()) uint64 {
771 var stats runtime.MemStats

Callers 1

BenchmarkAllocationsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected