Skip to documentation
SLOP

alloc_observe.producerId

Reference alloc_observe producerId

Internal implementation documentation

Defined in alloc_observe.

Allocates a nonzero, monotonically increasing identifier for an allocator producer when observation is enabled, or returns zero in disabled builds.

Called byCallsprivate sourcelib.alloc.observe.src.buffer.ObservedFirstinitprivate sourcelib.alloc.observe.src.debugObservedprivate sourcelib.alloc.observe.src.protocollockProducerRegistryprivate sourcelib.alloc.observe.src.protocoltakeIdalloc_observeproducerId
Static calls · unresolved targets: 0 · external targets: 1.

Source

Source: lib/alloc/observe/src/protocol.zig:523

zig
/// Allocates a nonzero, monotonically increasing identifier for an allocator/// producer when observation is enabled, or returns zero in disabled builds./// Identifiers are allocated independently of active sessions, protected by a/// registry lock that serializes allocation with session floor sampling./// Exhaustion of the identifier space causes a panic rather than a recoverable/// error. Generated values are unique only within the linked module instance,/// providing no global uniqueness across separate processes or independently/// loaded module binaries.pub inline fn producerId() u64 {    if (comptime !enabled) return 0;    lockProducerRegistry();    defer producer_registry_lock.unlock();    return takeId(&next_producer_id);}

Source: lib/alloc/observe/src/root.zig:503

zig
/// Allocates a nonzero, monotonically increasing identifier for an allocator/// producer when observation is enabled, or returns zero in disabled builds./// Identifiers are allocated independently of active sessions, protected by a/// registry lock that serializes allocation with session floor sampling./// Exhaustion of the identifier space causes a panic rather than a recoverable/// error. Generated values are unique only within the linked module instance,/// providing no global uniqueness across separate processes or independently/// loaded module binaries.pub const producerId = protocol.producerId;

Audit

Definitions1
Public names1
Members0
Version26.7.0
Revisiondaab053ee433