MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / grow

Method grow

aiscript-arena/src/allocator_api.rs:86–98  ·  view source on GitHub ↗
(
        &self,
        ptr: NonNull<u8>,
        old_layout: Layout,
        new_layout: Layout,
    )

Source from the content-addressed store, hash-verified

84
85 #[inline]
86 unsafe fn grow(
87 &self,
88 ptr: NonNull<u8>,
89 old_layout: Layout,
90 new_layout: Layout,
91 ) -> Result<NonNull<[u8]>, AllocError> {
92 unsafe {
93 let ptr = self.allocator.grow(ptr, old_layout, new_layout)?;
94 self.metrics
95 .mark_external_allocation(new_layout.size() - old_layout.size());
96 Ok(ptr)
97 }
98 }
99
100 #[inline]
101 unsafe fn grow_zeroed(

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected