Load/store raw pointers
ibraheemdev opened this issue · comments
Ibraheem Ahmed commented
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.
Jon Gjengset commented
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?
Ibraheem Ahmed commented
Ah, I missed HazardPointer::protect_ptr
, that works 👍