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

Method reserve_exact

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

Source from the content-addressed store, hash-verified

172 /// allocation failure.
173 #[inline]
174 pub fn reserve_exact(&mut self, additional: usize) -> Result<(), OutOfMemory> {
175 self.inner
176 .try_reserve_exact(additional)
177 .map_err(|_| OutOfMemory::new(self.len().saturating_add(additional)))
178 }
179
180 /// Same as [`std::string::String::push`] but returns an error on allocation
181 /// failure.

Callers 1

visit_strMethod · 0.45

Calls 3

try_reserve_exactMethod · 0.80
newFunction · 0.50
lenMethod · 0.45

Tested by

no test coverage detected