heapless
heapless copied to clipboard
Pool: Store the pointer to the next node and data in the same memory location.
Instead of having:
pub struct Node<T> {
next: AtomicPtr<Node<T>>,
pub(crate) data: UnsafeCell<T>,
}
We could just use one location to store both things, since we don't need to know both at the same time. I made a small PoC of this:
I still have to check a few things, but I would like some opinions about this, to see if it's really sound and worth it. I then can adapt this to heapless' code and make a PR if there's a disposition to merge.
Thanks for the PoC! I have been swamped lately so I have not had time to look at this, but it's on my TODO.