You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose to explicitly allow to allocate and deallocate with different implementations of Allocator trait under specified circumstances. I'm not sure how exactly it must be done, but I guess it would not increase complexity of Allocator trait while provide some benefits:
It can help Vec too, because on resize Vec is passing old pointer, so allocator might not need to store pointers to original data storage, reducing size of Vec<T, A>.
Resolve Split Allocator trait #112, because bumpalo can just allocate in Box<T, Bump> and then convert to Box<T, Noop>.
Kind of allow &move T, because it's semantics are quite similar to Box<T, Noop>.
Increase flexibility.
Maybe conversion can be allowed only via impl From<Box<T, A1>> for Box<T, A2> where A1: From<A2>, or just allow (declare sound) to Box::from_raw_in(Box::into_raw(box)).