Skip to content

Pool: Store the pointer to the next node and data in the same memory location. #167

@thalesfragoso

Description

@thalesfragoso

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:

Playground

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions