about summary refs log tree commit diff
path: root/src/liballoc/raw_vec
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-78/+0
2020-06-26Remove blank lineKRAAI, MATTHEW [VISUS]-1/+0
2020-06-19`#[deny(unsafe_op_in_unsafe_fn)]` in liballocLeSeulArtichaut-1/+1
2020-05-18Tiny Vecs are dumb.Nicholas Nethercote-1/+1
Currently, if you repeatedly push to an empty vector, the capacity growth sequence is 0, 1, 2, 4, 8, 16, etc. This commit changes the relevant code (the "amortized" growth strategy) to skip 1 and 2 in most cases, instead using 0, 4, 8, 16, etc. (You can still get a capacity of 1 or 2 using the "exact" growth strategy, e.g. via `reserve_exact()`.) This idea (along with the phrase "tiny Vecs are dumb") comes from the "doubling" growth strategy that was removed from `RawVec` in #72013. That strategy was barely ever used -- only when a `VecDeque` was grown, oddly enough -- which is why it was removed in #72013. (Fun fact: until just a few days ago, I thought the "doubling" strategy was used for repeated push case. In other words, this commit makes `Vec`s behave the way I always thought they behaved.) This change reduces the number of allocations done by rustc itself by 10% or more. It speeds up rustc, and will also speed up any other Rust program that uses `Vec`s a lot.
2020-03-26Remove alignment from `MemoryBlock`Tim Diekmann-2/+2
2020-03-26Fix issues from review and unsoundness of `RawVec::into_box`Tim Diekmann-10/+6
2020-03-26Overhaul of the `AllocRef` trait to match allocator-wg's latest consensTim Diekmann-2/+7
2020-03-08Allow ZSTs in `AllocRef`Tim Diekmann-1/+1
2020-03-03Remove `usable_size` APIsTim Diekmann-1/+1
2020-01-27Rename `Alloc` to `AllocRef`Tim Diekmann-1/+1
2019-11-29Format liballoc with rustfmtDavid Tolnay-2/+7
2019-09-06A few cosmetic improvements to code & comments in liballoc and libcoreAlexander Regueiro-3/+3
2019-08-02liballoc: Unconfigure tests during normal buildVadim Petrochenkov-0/+73
Remove additional libcore-like restrictions from liballoc, turns out the testing works ok if the tests are a part of liballoc itself.