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

Method reserve

crates/core/src/alloc/string.rs:165–169  ·  view source on GitHub ↗
(&mut self, additional: usize)

Source from the content-addressed store, hash-verified

163 /// allocation failure.
164 #[inline]
165 pub fn reserve(&mut self, additional: usize) -> Result<(), OutOfMemory> {
166 self.inner
167 .try_reserve(additional)
168 .map_err(|_| OutOfMemory::new(self.len().saturating_add(additional)))
169 }
170
171 /// Same as [`std::string::String::reserve_exact`] but returns an error on
172 /// allocation failure.

Callers 3

with_capacityMethod · 0.45
pushMethod · 0.45
push_strMethod · 0.45

Calls 3

try_reserveMethod · 0.80
newFunction · 0.50
lenMethod · 0.45

Tested by

no test coverage detected