wip: rewrite core to be template focused

This commit is contained in:
Jonathan Kelley committed 2022-10-27 21:58:47 -07:00
1 parent 67012c38df
commit 23603aaaf5
34 files changed
+3177 -2456

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
use std::cell::Cell;
use bumpalo::Bump;
use crate::nodes::VTemplate;
pub struct BumpFrame {
pub bump: Bump,
pub node: Cell<*const VTemplate<'static>>,
}
impl BumpFrame {
pub fn new(capacity: usize) -> Self {
let bump = Bump::with_capacity(capacity);
Self {
bump,
node: Cell::new(std::ptr::null()),
}
}
pub fn reset(&mut self) {
self.bump.reset();
self.node.set(std::ptr::null());
}
}