-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
rust-lang/rust
#70362Labels
Description
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:
growgrow_zeroedshrink
Lokathor and LesleyLaiTimDiekmann, Wodann and LesleyLai