jonhoo / haphazard

Hazard pointers in Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Load/store raw pointers

ibraheemdev opened this issue · comments

The new API makes it easy to load shared references and store newly allocated elements, but makes impossible to load a *mut T valid for deallocation, which is needed for data-structures like a Treiber stack. I don't think it is currently possible to implement a Treiber stack correctly with haphazard.

I'm not sure I follow? The old API is still there in haphazard::raw, and the higher-level AtomicPtr API has methods like load_ptr which I think does what you need. Or am I missing something?

Ah, I missed HazardPointer::protect_ptr, that works 👍