MCPcopy Create free account
hub / github.com/F-Stack/f-stack / _refcount_update_saturated

Function _refcount_update_saturated

freebsd/sys/refcount.h:51–59  ·  view source on GitHub ↗

* Attempt to handle reference count overflow and underflow. Force the counter * to stay at the saturation value so that a counter overflow cannot trigger * destruction of the containing object and instead leads to a less harmful * memory leak. */

Source from the content-addressed store, hash-verified

49 * memory leak.
50 */
51static __inline void
52_refcount_update_saturated(volatile u_int *count)
53{
54#ifdef INVARIANTS
55 panic("refcount %p wraparound", count);
56#else
57 atomic_store_int(count, REFCOUNT_SATURATION_VALUE);
58#endif
59}
60
61static __inline void
62refcount_init(volatile u_int *count, u_int value)

Callers 3

refcount_acquireFunction · 0.85
refcount_acquirenFunction · 0.85
refcount_releasenFunction · 0.85

Calls 1

panicFunction · 0.50

Tested by

no test coverage detected