MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / alloc_one

Method alloc_one

nodedb/src/control/database/registry.rs:98–102  ·  view source on GitHub ↗

Allocate a single database id.

(&self)

Source from the content-addressed store, hash-verified

96
97 /// Allocate a single database id.
98 pub fn alloc_one(&self) -> DatabaseId {
99 let prev = self.counter.fetch_add(1, Ordering::AcqRel);
100 self.allocs_since_flush.fetch_add(1, Ordering::AcqRel);
101 DatabaseId::new(prev)
102 }
103
104 /// Highest database id ever issued — `USER_DB_START - 1` if no user
105 /// allocations yet (meaning no user database has been created).

Calls

no outgoing calls