Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

alloc: make RawVec round up allocation sizes to next power-of-two #29848

Closed
wants to merge 2 commits into from

Commits on Dec 9, 2015

  1. docs: clarify String/Vec docs related to capacity

    * adds a note to String::shrink_to_fit to match the same note on Vec regarding
      additional capacity
    * change asserts in docs to treat capacity as a lower bound
    Swatinem committed Dec 9, 2015
    Configuration menu
    Copy the full SHA
    d41e599 View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2015

  1. alloc: make RawVec round up allocation sizes to next power-of-two

    The system allocator may give more memory than requested, usually rounding
    up to the next power-of-two.
    This PR uses a similar logic inside RawVec to be able to make use of this
    excess memory.
    
    NB: this is *not* used for `with_capacity` and `shrink_to_fit` pending
    discussion in rust-lang#29931
    Swatinem committed Dec 10, 2015
    Configuration menu
    Copy the full SHA
    352ff77 View commit details
    Browse the repository at this point in the history