aura-gui 0.3.5

UI nativa acelerada por GPU para escritorio, Android e iOS, en un solo crate: estilo tipo Tailwind, componentes, sombras, animaciones y agentes de IA. Reposo a cero. Licencia AGPL-3.0 o comercial.
//! Arena de asignación por frame: cero basura en el heap durante el render.

use bumpalo::Bump;

pub struct FrameArena {
    bump: Bump,
}

impl FrameArena {
    pub fn new() -> Self {
        Self { bump: Bump::new() }
    }

    pub fn alloc<T>(&self, value: T) -> &mut T {
        self.bump.alloc(value)
    }

    pub fn alloc_str(&self, text: &str) -> &str {
        self.bump.alloc_str(text)
    }

    /// Se invoca al terminar cada frame; conserva el chunk más grande.
    pub fn reset(&mut self) {
        self.bump.reset();
    }

    pub fn allocated_bytes(&self) -> usize {
        self.bump.allocated_bytes()
    }
}

impl Default for FrameArena {
    fn default() -> Self {
        Self::new()
    }
}