summary refs log tree commit diff
path: root/library/alloc/src/raw_vec.rs
AgeCommit message (Collapse)AuthorLines
2021-04-25get rid of min_const_fn references in library/ and rustdocRalf Jung-10/+4
2021-03-21fmt, change to coldBen Kimock-2/+6
2021-03-21Mark RawVec::reserve as inline and outline the resizing logicBen Kimock-1/+13
2021-01-26Auto merge of #79113 - andjo403:raw_vec_ptr, r=m-ou-sebors-0/+1
mark raw_vec::ptr with inline when a lot of vectors is used in a enum as in the example in #66617 if this function is not inlined and multiple cgus is used this results in huge compile times. with this fix the compile time is 6s from minutes for the example in #66617. I did not have the patience to wait for it to compile for more then 3 min.
2021-01-21Enforce statically that `MIN_NON_ZERO_CAP` is calculated at compile timeJoshua Nelson-16/+14
Previously, it would usually get computed by LLVM, but this enforces it.
2020-12-15Auto merge of #78682 - glandium:issue78471, r=lcnrbors-0/+1
Do not inline finish_grow Fixes #78471. Looking at libgkrust.a in Firefox, the sizes for the `gkrust.*.o` file is: - 18584816 (text) 582418 (data) with unmodified master - 17937659 (text) 582554 (data) with #72227 reverted - 17968228 (text) 582858 (data) with `#[inline(never)]` on `grow_amortized` and `grow_exact`, but that has some performance consequences - 17927760 (text) 582322 (data) with this change So in terms of size, at least in the case of Firefox, this patch more than undoes the regression. I don't think it should affect performance, but we'll see.
2020-12-08Do not inline finish_growMike Hommey-0/+1
We also change the specialization of `SpecFromIterNested::from_iter` for `TrustedLen` to use `Vec::with_capacity` when the iterator has a proper size hint, instead of `Vec::new`, avoiding calls to `grow_*` and thus `finish_grow` in some fully inlinable cases, which would regress with this change. Fixes #78471.
2020-12-04 Rename `AllocRef` to `Allocator` and `(de)alloc` to `(de)allocate`Tim Diekmann-12/+12
2020-11-22Auto merge of #79219 - shepmaster:beta-bump, r=Mark-Simulacrumbors-2/+1
Bump bootstrap compiler version r? `@Mark-Simulacrum` /cc `@pietroalbini`
2020-11-19Bump bootstrap compiler versionJake Goulding-2/+1
2020-11-18Add support for custom allocators in `Vec`Tim Diekmann-6/+1
2020-11-16mark raw_vec::ptr with inlineAndreas Jonson-0/+1
2020-11-16Rollup merge of #77691 - exrook:rename-layouterr, r=KodrAusMara Bos-2/+2
Rename/Deprecate LayoutErr in favor of LayoutError Implements rust-lang/wg-allocators#73. This patch renames LayoutErr to LayoutError, and uses a type alias to support users using the old name. The new name will be instantly stable in release 1.49 (current nightly), the type alias will become deprecated in release 1.51 (so that when the current nightly is 1.51, 1.49 will be stable). This is the only error type in `std` that ends in `Err` rather than `Error`, if this PR lands all stdlib error types will end in `Error` :smiling_face_with_three_hearts:
2020-10-25Merge remote-tracking branch 'upstream/master' into box-allocTim Diekmann-2/+3
2020-10-25Rollup merge of #78208 - liketechnik:issue-69399, r=oli-obkYuki Okushi-1/+2
replace `#[allow_internal_unstable]` with `#[rustc_allow_const_fn_unstable]` for `const fn`s `#[allow_internal_unstable]` is currently used to side-step feature gate and stability checks. While it was originally only meant to be used only on macros, its use was expanded to `const fn`s. This pr adds stricter checks for the usage of `#[allow_internal_unstable]` (only on macros) and introduces the `#[rustc_allow_const_fn_unstable]` attribute for usage on `const fn`s. This pr does not change any of the functionality associated with the use of `#[allow_internal_unstable]` on macros or the usage of `#[rustc_allow_const_fn_unstable]` (instead of `#[allow_internal_unstable]`) on `const fn`s (see https://github.com/rust-lang/rust/issues/69399#issuecomment-712911540). Note: The check for `#[rustc_allow_const_fn_unstable]` currently only validates that the attribute is used on a function, because I don't know how I would check if the function is a `const fn` at the place of the check. I therefore openend this as a 'draft pull request'. Closes rust-lang/rust#69399 r? @oli-obk
2020-10-21switch allow_internal_unstable const fns to rustc_allow_const_fn_unstableFlorian Warzecha-1/+2
2020-10-15Following #74010 by converting some newer cases of backticked O notations to ↵Ryan Scott-1/+1
be italicized
2020-10-08Rename LayoutErr to LayoutError outside of coreJacob Hughes-2/+2
2020-10-07Support custom allocators in `Box`Tim Diekmann-30/+30
Remove `Box::leak_with_alloc` Add leak-test for box with allocator Rename `AllocErr` to `AllocError` in leak-test Add `Box::alloc` and adjust examples to use the new API
2020-09-23Rollup merge of #76993 - blitzerr:alloc-ref, r=AmanieuDylan DPC-1/+1
Changing the alloc() to accept &self instead of &mut self Fixes: [#55](https://github.com/rust-lang/wg-allocators/issues/55) This is the first cut. It only makes the change for `alloc` method.
2020-09-22Update library functions with stability attributesDylan MacKenzie-0/+1
This may not be strictly minimal, but all unstable functions also need a `rustc_const_unstable` attribute.
2020-09-22removing &mut self for other methods of AllocRefblitzerr-1/+1
2020-09-21Rollup merge of #72734 - pickfire:liballoc, r=KodrAusecstatic-morse-15/+13
Reduce duplicate in liballoc reserve error handling Not sure if it affects compilation time.
2020-09-19Use `T::BITS` instead of `size_of::<T> * 8`.Mara Bos-1/+1
2020-08-22Reduce duplicate in liballoc reserve error handlingIvan Tham-15/+13
2020-08-20Assume same alignment in `RawVec`Tim Diekmann-1/+6
2020-08-20Add debug assertion for equal alignment in RawVecTim Diekmann-0/+1
2020-08-19Allow reallocation to different alignmentTim Diekmann-7/+6
2020-08-09Rollup merge of #75151 - pickfire:patch-4, r=LukasKalbertodtYuki Okushi-4/+6
Consistent variable name alloc for raw_vec
2020-08-04Replace `Memoryblock` with `NonNull<[u8]>`Tim Diekmann-15/+15
2020-08-04Consistent variable name alloc for raw_vecIvan Tham-4/+6
2020-07-28Remove in-place allocation and revert to separate methods for zeroed allocationsTim Diekmann-22/+22
Fix docs
2020-07-27mv std libs to library/mark-0/+536