Closed TimDiekmann closed 4 years ago
Is there a discussion somewhere about why X_excess
isn't just called X
; i.e., all of the "default" functions return the actual allocation size which can be used or ignored? Are there allocators which have different behavior when _excess
is called (and should that behavior be supported)?
@adlerd Sorry, somehow I haven't noticed your question. Yes, #17 proposes to remove the usable_size
API and rename the x_excess
to x
.
Returning
Excess
when allocating is useful for collections like (Raw
)Vec
. Currently, only these methods are provided:alloc_excess
realloc_excess
In order to make those collection work with the excess api, these methods have to be added:
alloc_zeroed_excess
grow_in_place_excess
shrink_in_place_excess