MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / alloc_slow

Method alloc_slow

crates/core/src/slab.rs:380–387  ·  view source on GitHub ↗
(&mut self, value: T)

Source from the content-addressed store, hash-verified

378 #[inline(never)]
379 #[cold]
380 fn alloc_slow(&mut self, value: T) -> Result<Id, OutOfMemory> {
381 // Reserve additional capacity, since we didn't have space for the
382 // allocation.
383 self.double_capacity()?;
384 // After which the allocation will succeed.
385 let id = self.try_alloc(value).ok().unwrap();
386 Ok(id)
387 }
388
389 /// Get a shared borrow of the value associated with `id`.
390 ///

Callers 1

allocMethod · 0.45

Calls 5

OkFunction · 0.85
double_capacityMethod · 0.80
try_allocMethod · 0.80
unwrapMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected