Closed a1phyr closed 3 months ago
How common is manually implementing clone_from
? I don't think I've seen it done in other crates
This would avoid the allocation but potentially "leak" memory if the image started out substantially larger than the new size. (Technically not a leak because the memory would still remain referenced but inaccessible.) Though perhaps that's well known behavior and folks using the method would expect that?
I think it's fine that clone_from
keeps potentially large allocations. It's opt-in, and its purpose is to reuse allocations.
I license past and future contributions under the dual MIT/Apache-2.0 license, allowing licensees to choose either at their option.