wip: pre any props
This commit is contained in:
1 parent
12808ec0aa
commit
493591400f
14 files changed
+399
-381
No files matched your search
@@ -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()) }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user