Skip to content

Missing methods for returning excess in Alloc #13

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
TimDiekmann opened this issue May 4, 2019 · 2 comments
Closed

Missing methods for returning excess in Alloc #13

TimDiekmann opened this issue May 4, 2019 · 2 comments
Labels
A-Alloc Trait Issues regarding the Alloc trait Proposal

Comments

@TimDiekmann
Copy link
Member

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
@TimDiekmann TimDiekmann added Discussion Issues containing a specific idea, which needs to be discussed in the WG A-Alloc Trait Issues regarding the Alloc trait labels May 4, 2019
@adlerd
Copy link

adlerd commented Sep 10, 2019

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)?

@TimDiekmann TimDiekmann added Proposal and removed Discussion Issues containing a specific idea, which needs to be discussed in the WG labels Oct 17, 2019
@TimDiekmann
Copy link
Member Author

@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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-Alloc Trait Issues regarding the Alloc trait Proposal
Projects
None yet
Development

No branches or pull requests

2 participants