Closed haberman closed 2 years ago
If it was send then bump would have to be sync (which it very much is not) since the vec holds a ref to the bump and will use it to realloc as needed when capacity gets filled and another item is being pushed
Note that std vec is only send when the A is send, which wouldn’t be true when A=&’a Bump
I forgot that the vec holds a ref to the bump.
I guess it could work if the bump was passed explicitly for all operations that can realloc? That would be a different type though.
Currently
bumpalo::collections::vec::Vec
is notSend
. Is there a reason for this?I notice that
std::vec::Vec
isSend
. It seems like both the standardVec
and the bumpaloVec
will point at unaliased memory, soSend
should be safe?Digging a little deeper, I notice that
bumpalo::collections::RawVec
usesNonNull<T>
for its pointer, whereasstd::vec::Vec
usesUnique<T>
. Perhaps the bumpalo Vec could useUnique<T>
also?