MCPcopy Create free account
hub / github.com/dropbox/rust-alloc-no-stdlib / clear_if_necessary

Method clear_if_necessary

src/stack_allocator.rs:25–32  ·  view source on GitHub ↗
(self : &Self, index : usize, data : AllocatedStackMemory<'a, T>)

Source from the content-addressed store, hash-verified

23impl <'a, T : 'a, U : allocated_memory::AllocatedSlice<&'a mut[T]> >
24 StackAllocator <'a, T, U> {
25 fn clear_if_necessary(self : &Self, index : usize, data : AllocatedStackMemory<'a, T>)
26 -> AllocatedStackMemory<'a, T> {
27 if index + 1 != self.system_resources.slice().len() {
28 let fnp = self.initialize;
29 fnp(data.mem);
30 }
31 return data;
32 }
33}
34impl<'a, T : 'a, U : allocated_memory::AllocatedSlice<&'a mut[T]> >
35 Allocator<T> for StackAllocator <'a, T, U> {

Callers 1

alloc_cellMethod · 0.80

Calls 2

lenMethod · 0.80
sliceMethod · 0.45

Tested by

no test coverage detected