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
If you think about it, growing and shrinking an allocation are actually 2 very different operations. The only reason for merging them together is historical, because C did it.
If you look at Vec, the biggest user of realloc, you will see that growing and shrinking are two completely separate code paths. Similarly, within allocator implementations, growing and shrinking are also often handled differently.
As such, it makes sense to remove realloc and realloc_zeroed and add three new methods:
grow
grow_zeroed
shrink
Lokathor and LesleyLaiTimDiekmann, Wodann and LesleyLai