MCPcopy Create free account
hub / github.com/Houseofmvps/codesight / alloc

Function alloc

plugins/ast/rust/src/lib.rs:53–59  ·  view source on GitHub ↗
(length: usize)

Source from the content-addressed store, hash-verified

51
52#[unsafe(no_mangle)]
53pub extern "C" fn alloc(length: usize) -> *mut u8 {
54 if length == 0 {
55 return core::ptr::null_mut();
56 }
57
58 unsafe { std::alloc::alloc(MemoryLayout::from_size_align_unchecked(length, 1)) }
59}
60
61/// # Safety
62/// `ptr`/`len` must come from a prior `alloc` call.

Callers 1

reportFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected