ndarray icon indicating copy to clipboard operation
ndarray copied to clipboard

Add `.shrink_to_fit()` for `Array`

Open bluss opened this issue 1 year ago • 1 comments
trafficstars

Add .shrink_to_fit() for owned storage arrays. This initial version does not change array strides, this is to avoid the most tricky part of the implementation (and maybe take it step by step).

Care must be taken since self.ptr points inside the allocation - which for Array is still Vec-allocated, and several Vec methods including its shrink_to_fit can reallocate the array.

bluss avatar Aug 18 '24 11:08 bluss