sync/atomic.CompareAndSwapPointer
standard libraryThe 8502nd most-called standard-library function by production calls. Called 79 times across 23 modules; 70 of those run outside tests and generated code.
- prod calls
- 70
- non-test, non-generated
- all calls
- 79
- total callsites
- modules
- 23
- distinct callers
- in loop
- 56%
- of prod calls
- in tests
- 6%
- 5 calls
- resolved
- 100%
- to a known target
resolution mix
How each call resolves
How each call was attributed. Only resolved kinds, where the target function is known, count toward the ranking. Interface dispatch and unresolved receivers are reported separately and never guessed. Read the taxonomy →
- Package function100%A direct call to an exported package function, resolved by type.
who calls this
Notable callers
Production calls into CompareAndSwapPointer from notable Go projects. Open one on the map to see what else it hammers.
- CockroachDB 6 9%
- Protocol Buffers 5 7%
- gRPC 4 6%
- Uber Go 1 1%
where it's called
Callsites in the wild
12 representative callsites of 79, prioritizing in-loop and non-test usage. We link to source, never display it.
-
cockroachdb/cockroach @v19.2.12+incompatible
in loop - in loop
-
RomiChan/syncx @v0.0.0-20240418144900-b7402ffdebc7
in loop - in loop
- in loop
-
google/grumpy @v0.0.0-20171122020858-3ec87959189c
in loop -
google/gvisor @v0.0.0-20260805052044-b67f1412986c
in loop -
op/go-logging @v0.0.0-20160315200505-970db520ece7
in loop - in loop
-
sagernet/gvisor @v0.0.0-20260727.0-sing-box-mod.1
in loop -
tylertreat/BoomFilters @v0.0.0-20251117164519-53813c36cc1b
in loop -
cockroachdb/cockroach @v19.2.12+incompatible
in loop
top callers
The modules that reach for it
The modules that call CompareAndSwapPointer most in this snapshot.
- github.com/bytedance/gopkg1418%
- github.com/syndtr/goleveldb911%
- github.com/cockroachdb/cockroach68%
- github.com/sagernet/gvisor68%
- github.com/IceWhaleTech/CasaOS56%
siblings
More from sync/atomic
The other most-called functions in this package. See all →