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

Method try_reserve

cranelift/entity/src/primary.rs:165–169  ·  view source on GitHub ↗

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

(&mut self, additional: usize)

Source from the content-addressed store, hash-verified

163
164 /// Like `reserve` but returns an error on allocation failure.
165 pub fn try_reserve(&mut self, additional: usize) -> Result<(), OutOfMemory> {
166 self.elems
167 .try_reserve(additional)
168 .map_err(|_| OutOfMemory::new(self.len().saturating_add(additional)))
169 }
170
171 /// Reserves the minimum capacity for exactly `additional` more elements to be inserted.
172 pub fn reserve_exact(&mut self, additional: usize) {

Callers 14

alloc_nodeMethod · 0.80
try_with_capacityMethod · 0.80
try_with_capacityMethod · 0.80
try_resizeMethod · 0.80
reserveMethod · 0.80
reserveMethod · 0.80
write_strMethod · 0.80
newMethod · 0.80
grow_toMethod · 0.80
reserveMethod · 0.80
reserveMethod · 0.80
reserveMethod · 0.80

Calls 2

newFunction · 0.50
lenMethod · 0.45

Tested by 1

primary_map_try_reserveFunction · 0.64