Split owned Vec<T> without reallocation

It is conceivable that this could be made to work, and I've occasionally wished for it as well. But as far as I know, there's currently no way to tell the allocator "Hey I got this piece of memory from you, now please pretend you gave it to me as two separate, contiguous allocations". In fact, this may be fundamentally incompatible with how some allocators work (e.g., if it stores some metadata right next to each allocation). But I wish it were possible on a best-effort basis, I just don't know if any allocators provide an interface to do it.

1 Like