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

Method try_reserve_exact

cranelift/entity/src/primary.rs:177–181  ·  view source on GitHub ↗

Like `reserve_exact` but returns an error on allocation failure.

(&mut self, additional: usize)

Source from the content-addressed store, hash-verified

175
176 /// Like `reserve_exact` but returns an error on allocation failure.
177 pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), OutOfMemory> {
178 self.elems
179 .try_reserve_exact(additional)
180 .map_err(|_| OutOfMemory::new(self.len().saturating_add(additional)))
181 }
182
183 /// Shrinks the capacity of the `PrimaryMap` as much as possible.
184 pub fn shrink_to_fit(&mut self) {

Callers 5

reserve_exactMethod · 0.80
reserve_exactMethod · 0.80
reserve_exactMethod · 0.80
reserve_exactMethod · 0.80

Calls 2

newFunction · 0.50
lenMethod · 0.45

Tested by 1