MCPcopy
hub / github.com/grpc/grpc-go / register

Method register

internal/leakcheck/leakcheck.go:414–422  ·  view source on GitHub ↗

register records the stack trace.

()

Source from the content-addressed store, hash-verified

412
413// register records the stack trace.
414func (rt *reporterTracker) register() *int {
415 rt.mu.Lock()
416 defer rt.mu.Unlock()
417
418 id := new(int)
419 // Skip 4 frames: register -> internal.Delegate -> stats.RegisterAsyncReporter -> Caller
420 rt.allocations[id] = currentStack(4)
421 return id
422}
423
424// unregister removes the ID.
425func (rt *reporterTracker) unregister(id *int) {

Callers 1

TrackAsyncReportersFunction · 0.45

Calls 3

currentStackFunction · 0.85
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected