MCPcopy Create free account
hub / github.com/PerroEngine/Perro / contains_parts

Method contains_parts

perro_source/render_stack/perro_graphics/src/resources.rs:35–46  ·  view source on GitHub ↗
(&self, index: u32, generation: u32)

Source from the content-addressed store, hash-verified

33
34#[derive(Default)]
35struct SlotArena {
36 generations: Vec<u32>,
37 occupied: Vec<bool>,
38 free_slots: Vec<usize>,
39}
40
41impl SlotArena {
42 #[inline]
43 fn create_parts(&mut self) -> (u32, u32) {
44 if let Some(slot) = self.free_slots.pop() {
45 self.generations[slot] = self.generations[slot].wrapping_add(1);
46 self.occupied[slot] = true;
47 return ((slot + 1) as u32, self.generations[slot]);
48 }
49

Callers 4

remove_partsMethod · 0.45
has_textureMethod · 0.45
has_meshMethod · 0.45
has_materialMethod · 0.45

Calls 1

getMethod · 0.45

Tested by

no test coverage detected