(after, before uint64)
| 37 | } |
| 38 | |
| 39 | func 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 |
| 59 | type Profiler struct { |
no outgoing calls
no test coverage detected