about summary refs log tree commit diff
path: root/src/liballoc
AgeCommit message (Collapse)AuthorLines
2018-12-04Add example of using the indexing operator to BTreeMap docsCorey Farwell-0/+3
2018-12-04cleanup: remove static lifetimes from constsljedrz-1/+1
2018-12-03slice: tweak concat & joinljedrz-3/+3
2018-12-03Rollup merge of #56432 - ordovicia:shrink-to-issue, r=Centrilkennytm-4/+4
Update issue number of `shrink_to` methods to point the tracking issue Tracking issue: #56431
2018-12-03Rollup merge of #56401 - scottmcm:vecdeque-resize-with, r=dtolnaykennytm-33/+27
Move VecDeque::resize_with out of the impl<T:Clone> block I put this in the wrong `impl` block in https://github.com/rust-lang/rust/pull/56016, so fixing. Tracking issue for the unstable method: https://github.com/rust-lang/rust/issues/41758#issuecomment-443077953
2018-12-03Fix link in Weak::newThomas de Zeeuw-1/+2
2018-12-03Add sync::Weak::ptr_eqThomas de Zeeuw-0/+47
2018-12-03Add rc::Weak.ptr_eqThomas de Zeeuw-0/+46
2018-12-02Auto merge of #56275 - RalfJung:win-mutex, r=SimonSapinbors-2/+2
use MaybeUninit instead of mem::uninitialized for Windows Mutex I hope this builds, I do not have a Windows machine to test...
2018-12-02avoid MaybeUninit::get_mut where it is not neededRalf Jung-2/+2
2018-12-02Update issue number of `shrink_to` methods to point the tracking issueHidehito Yabuuchi-4/+4
2018-12-01Redo the docs for Vec::set_lenScott McMurray-27/+53
Inspired by the recent conversation on IRLO.
2018-11-30Move VecDeque::resize_with out of the impl<T:Clone> blockScott McMurray-33/+27
2018-12-01Rollup merge of #56131 - ljedrz:assorted, r=RalfJungkennytm-0/+2
Assorted tweaks - preallocate `VecDeque` in `Decodable::decode` (as it is done with other collections which can do it) - add a FIXME to `String::from_utf16` r? @RalfJung
2018-11-23Merge branch 'master' into frewsxcv-dynCorey Farwell-6/+20
2018-11-22Auto merge of #53918 - Havvy:doc-sort-by, r=GuillaumeGomezbors-0/+16
Doc total order requirement of sort(_unstable)_by I took the definition of what a total order is from the Ord trait docs. I specifically put "elements of the slice" because if you have a slice of f64s, but know none are NaN, then sorting by partial ord is total in this case. I'm not sure if I should give such an example in the docs or not. r? @GuillaumeGomez
2018-11-21update various stdlib docsSteve Klabnik-6/+4
2018-11-21String: add a FIXME to from_utf16ljedrz-0/+2
2018-11-20Incorporate `dyn` into more comments and docs.Corey Farwell-10/+10
2018-11-17Add VecDeque::resize_withScott McMurray-1/+39
2018-11-17Add double quotes to resolve errordaniellimws-1/+1
2018-11-15Rollup merge of #55901 - euclio:speling, r=petrochenkovPietro Albini-2/+2
fix various typos in doc comments
2018-11-15Rollup merge of #55530 - ljedrz:speed_up_String_from_utf16, r=SimonSapinPietro Albini-1/+9
Speed up String::from_utf16 Collecting into a `Result` is idiomatic, but not necessarily fast due to rustc not being able to preallocate for the resulting collection. This is fine in case of an error, but IMO we should optimize for the common case, i.e. a successful conversion. This changes the behavior of `String::from_utf16` from collecting into a `Result` to pushing to a preallocated `String` in a loop. According to [my simple benchmark](https://gist.github.com/ljedrz/953a3fb74058806519bd4d640d6f65ae) this change makes `String::from_utf16` around **twice** as fast.
2018-11-13fix various typos in doc commentsAndy Russell-2/+2
2018-11-13Rollup merge of #55889 - RalfJung:global-alloc, r=alexcrichtonkennytm-0/+4
global allocators: add a few comments These comments answer some questions that came up when I tried to understand how the control flow works for the global allocator, `Global` and `System`. r? @alexcrichton
2018-11-13Rollup merge of #55874 - denisvasilik:docs, r=alexcrichtonkennytm-0/+41
string: Add documentation for `From` impls Hi this is part of #51430. I'm a first time contributor, so I started with a small task adding a bit of documentation for From impls.
2018-11-13Rollup merge of #55843 - Axary:master, r=sfacklerkennytm-1/+17
add FromIterator<A> to Box<[A]>
2018-11-13Rollup merge of #55711 - kngwyu:btreemap-rangemut-doc, r=Mark-Simulacrumkennytm-3/+4
Format BtreeMap::range_mut example Before: ![image](https://user-images.githubusercontent.com/16046705/48049184-36517780-e1e1-11e8-8da2-a3ae858d5a76.png) After: ![image](https://user-images.githubusercontent.com/16046705/48049210-45382a00-e1e1-11e8-87b3-84ae60ef798e.png)
2018-11-12global allocators: add a few commentsRalf Jung-0/+4
2018-11-11Minor style guide corrections.Denis Vasilik-6/+6
2018-11-11std: Delete the `alloc_system` crateAlex Crichton-4/+1
This commit deletes the `alloc_system` crate from the standard distribution. This unstable crate is no longer needed in the modern stable global allocator world, but rather its functionality is folded directly into the standard library. The standard library was already the only stable location to access this crate, and as a result this should not affect any stable code.
2018-11-11Whitespace cleanup according to Rust's style guidelines.Denis Vasilik-3/+3
2018-11-11Added comments for trait implementations.Denis Vasilik-1/+28
2018-11-11Added comment for From trait implementation: boxed string slice to StringDenis Vasilik-0/+14
2018-11-11change attribute to stableAxary-1/+1
2018-11-11Merge branch 'master' of https://github.com/rust-lang/rustAxary-4/+8
2018-11-10add FromIterator<A> to Box<[A]>Axary-1/+17
2018-11-08Fix Rc/Arc allocation layoutMurarth-4/+8
* Rounds allocation layout up to a multiple of alignment * Adds a convenience method `Layout::pad_to_align` to perform rounding
2018-11-08Auto merge of #55366 - Amanieu:stable_layout, r=Amanieubors-0/+1
Add tracking issue for Layout methods (and some API changes) These methods are already useful when used with the stable global allocator API (stabilized in #51241). ```rust pub fn align_to(&self, align: usize) -> Result<Layout, LayoutErr>; pub fn padding_needed_for(&self, align: usize) -> usize; pub fn repeat(&self, n: usize) -> Result<(Layout, usize), LayoutErr>; pub fn extend(&self, next: Layout) -> Result<(Layout, usize), LayoutErr>; pub fn repeat_packed(&self, n: usize) -> Result<Layout, LayoutErr>; pub fn extend_packed(&self, next: Layout) -> Result<Layout, LayoutErr>; pub fn array<T>(n: usize) -> Result<Layout, LayoutErr>; ``` cc #32838 r? @SimonSapin
2018-11-07Rollup merge of #55734 - teresy:shorthand-fields, r=davidtwcokennytm-1/+1
refactor: use shorthand fields refactor: use shorthand for single fields everywhere (excluding tests).
2018-11-06Add a tracking issue for extra Layout methodsAmanieu d'Antras-0/+1
2018-11-06refactor: use shorthand fieldsteresy-1/+1
2018-11-06Format BtreeMap::range_mut examplekngwyu-3/+4
2018-11-05Auto merge of #54922 - murarth:rc-ub-fix, r=alexcrichtonbors-10/+14
Fix undefined behavior in Rc/Arc allocation Manually calculate allocation layout for `Rc`/`Arc` to avoid undefined behavior Closes #54908
2018-11-05Fix undefined behavior in Rc/Arc allocationMurarth-10/+14
Manually calculate allocation layout for `Rc`/`Arc` to avoid undefined behavior
2018-11-03Auto merge of #55238 - alexcrichton:rm-jemalloc, r=estebankbors-3/+0
Remove the `alloc_jemalloc` crate This commit removes the `alloc_jemalloc` crate from the standard library and all related configuration. We will no longer be shipping this unstable crate. Rationale for this is provided on https://github.com/rust-lang/rust/issues/36963 and the many linked issues, but I can inline rationale here if desired! We currently rely on jemalloc for increased perf in the Rust compiler, however. [This perf run shows](https://perf.rust-lang.org/compare.html?start=74ff7dcb1388e60a613cd6050bcd372a3cc4998b&end=7e7928dc0340d79b404e93f0c79eb4b946c1d669&stat=wall-time) that if we switch to glibc 2.23's allocator that it's slower than jemalloc across many benchmarks. [This perf run, however](https://perf.rust-lang.org/compare.html?start=22cc2ae8057d14e980b7c784e1eb2eee26b59e7d&end=10c95ccfa7a7adc12f4e608621ca29f9b98eed29), shows that if we use `jemalloc-sys` from crates.io then rustc actually gets faster across all benchmarks! (presumably because it has a more recent version of jemalloc than our submodule). As a result, it's expected that this doesn't regress any code (as it's just removing an unstable crate) and it should actually improve rustc performance because it updates jemalloc. Closes #36963
2018-11-02Remove all jemalloc-related contentAlex Crichton-3/+0
This commit removes all jemalloc related submodules, configuration, etc, from the bootstrap, from the standard library, and from the compiler. This will be followed up with a change to use jemalloc specifically as part of rustc on blessed platforms.
2018-11-01Replace CoerceSized trait with DispatchFromDynMichael Hewson-14/+14
Rename `CoerceSized` to `DispatchFromDyn`, and reverse the direction so that, for example, you write ``` impl<T: Unsize<U>, U> DispatchFromDyn<*const U> for *const T {} ``` instead of ``` impl<T: Unsize<U>, U> DispatchFromDyn<*const T> for *const U {} ``` this way the trait is really just a subset of `CoerceUnsized`. The checks in object_safety.rs are updated for the new trait, and some documentation and method names in there are updated for the new trait name — e.g. `receiver_is_coercible` is now called `receiver_is_dispatchable`. Since the trait now works in the opposite direction, some code had to updated here for that too. I did not update the error messages for invalid `CoerceSized` (now `DispatchFromDyn`) implementations, except to find/replace `CoerceSized` with `DispatchFromDyn`. Will ask for suggestions in the PR thread.
2018-11-01Add CoerceSized impls throughout libstdMichael Hewson-3/+18
This will make receiver types like `Rc<Self>` and `Pin<&mut Self>` object-safe.
2018-10-31Bump nightly to 1.32.0Alex Crichton-4/+2
* Also update the bootstrap compiler * Update cargo to 1.32.0 * Clean out stage0 annotations