MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / take

Method take

crates/core/src/host/instance_env.rs:135–137  ·  view source on GitHub ↗

Takes an unused chunk from this pool or creates a new chunk if none are available. New chunks are not actually allocated, but will be, on first use.

(&mut self)

Source from the content-addressed store, hash-verified

133 /// New chunks are not actually allocated,
134 /// but will be, on first use.
135 fn take(&mut self) -> Vec<u8> {
136 self.free_chunks.pop().unwrap_or_default()
137 }
138
139 /// Return a chunk back to the pool, or frees it, as appropriate.
140 ///

Callers 5

flushMethod · 0.45
newMethod · 0.45
take_txMethod · 0.45
setMethod · 0.45

Calls 1

lockMethod · 0.80

Tested by

no test coverage detected