MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / allocate

Method allocate

src/pglite/postgres_mod.rs:2908–2917  ·  view source on GitHub ↗
(&self, store: &mut Store, len: i32)

Source from the content-addressed store, hash-verified

2906 }
2907
2908 fn allocate(&self, store: &mut Store, len: i32) -> Result<i32> {
2909 let ptr = self
2910 .malloc
2911 .call(&mut *store, len)
2912 .context("malloc guest allocation")?;
2913 ensure!(ptr > 0, "malloc returned null for guest allocation");
2914 #[cfg(debug_assertions)]
2915 self.allocations.set(self.allocations.get() + 1);
2916 Ok(ptr)
2917 }
2918
2919 fn run_and_free<R>(
2920 &self,

Callers 2

with_bytesMethod · 0.80
with_allocationMethod · 0.80

Calls 1

setMethod · 0.80

Tested by

no test coverage detected