MCPcopy
hub / github.com/github/github-mcp-server / safeMemoryDelta

Function safeMemoryDelta

internal/profiler/profiler.go:39–56  ·  view source on GitHub ↗
(after, before uint64)

Source from the content-addressed store, hash-verified

37}
38
39func safeMemoryDelta(after, before uint64) int64 {
40 if after > math.MaxInt64 || before > math.MaxInt64 {
41 if after >= before {
42 diff := after - before
43 if diff > math.MaxInt64 {
44 return math.MaxInt64
45 }
46 return int64(diff)
47 }
48 diff := before - after
49 if diff > math.MaxInt64 {
50 return -math.MaxInt64
51 }
52 return -int64(diff)
53 }
54
55 return int64(after) - int64(before)
56}
57
58// Profiler provides minimal performance profiling capabilities
59type Profiler struct {

Callers 3

ProfileFuncMethod · 0.85
StartMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected