drone-os/drone-core

Memory alignment in src::fib::chain::Node cannot be guaranteed

qiuchengxuan opened this issue · 0 comments

#[repr(C)]                                                                                                                                     
pub struct Node<F> {                                                                                                                           
    advance: unsafe fn(*mut ListNode<Node<()>>) -> bool,                                                                                       
    deallocate: unsafe fn(*mut ListNode<Node<()>>),                                                                                            
    fib: F,                                                                                                                                    
}

Since F here is a closure which memory alignment is uncertain, fib should be boxed or by other means to avoid unexpected memory align.