wip: pre any props

This commit is contained in:
Jonathan Kelley committed 2022-11-19 17:07:29 -08:00
1 parent 12808ec0aa
commit 493591400f
14 files changed
+399 -381

No files matched your search

+3 -3
View File
@@ -1,13 +1,12 @@
use std::cell::Cell;
use bumpalo::Bump;
use crate::factory::RenderReturn;
use bumpalo::Bump;
pub struct BumpFrame {
pub bump: Bump,
pub node: Cell<*mut RenderReturn<'static>>,
}
impl BumpFrame {
pub fn new(capacity: usize) -> Self {
let bump = Bump::with_capacity(capacity);
@@ -22,6 +21,7 @@ impl BumpFrame {
self.node.set(std::ptr::null_mut());
}
/// Creates a new lifetime out of thin air
pub unsafe fn load_node<'b>(&self) -> &'b RenderReturn<'b> {
unsafe { std::mem::transmute(&*self.node.get()) }
}