Closed jkelleyrtp closed 3 years ago
Yes references are stable. There is no inline storage space within a Bump
and the allocated storage never moves.
If bumps grows then it will need to be resized. Will the references into the bump remain stable, meaning it's still okay to cast
*mut T
back to&mut T
?
Existing storage space is never resized, new chunks are allocated.
Asking this because I'd like to store references into the bump along with the bump itself via OwningRef (or by raw pointer directly).
If bumps grows then it will need to be resized. Will the references into the bump remain stable, meaning it's still okay to cast
*mut T
back to&mut T
?If not, how would you go about stably storing the bump alongside objects it has allocated?
I know Dodrio does this for
CachedNodes
, but I can't help but think that that particular implementation is unsound if the CachedNodes Fxhashmap needs to be resized.