canvas icon indicating copy to clipboard operation
canvas copied to clipboard

Add realloc based `TexelBuffer<T>::into_vec(self) -> Vec<T>`

Open 197g opened this issue 3 years ago • 0 comments

This can be more efficient than use to_owned() on a deref'd slice. By letting the allocator decide if the allocation can be reused with a different alignment, it can elide a memcpy operation in some cases. Presumably, at least a lot of cases. Other alignment-aware allocators may be able to just move the allocation to a new bucket instead.

197g avatar May 26 '22 15:05 197g