Commit Graph

15 Commits

Author SHA1 Message Date
Aaron Kutch
ad7fdb6859 Improve ptr_rotate performance, tests, and benchmarks 2019-08-06 10:42:48 -05:00
Matthias Geier
0967d28be7 Rename .cap() methods to .capacity()
... but leave the old names in there for backwards compatibility.
2019-04-27 22:43:10 +02:00
Taiki Endo
360432f1e8 libcore => 2018 2019-04-18 14:47:35 +09:00
Ralf Jung
0e0383abc6 adjust MaybeUninit API to discussions
uninitialized -> uninit
into_initialized -> assume_init
read_initialized -> read
set -> write
2019-03-26 09:21:32 +01:00
Alexander Regueiro
b87363e763 tests: doc comments 2019-02-10 23:42:32 +00:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Ralf Jung
525e8f4368 use MaybeUninit in core::slice::rotate
Code by @japaric, I just split it into individual commits
2018-11-23 22:50:20 +01:00
Ralf Jung
e37d6d37e7 Revert "Auto merge of #53508 - japaric:maybe-uninit, r=RalfJung"
This reverts commit c6e3d7fa31, reversing
changes made to 4591a245c7.
2018-09-29 09:50:50 +02:00
Jorge Aparicio
af101fdc33 address Mark-Simulacrum comments 2018-09-22 21:01:21 +02:00
Jorge Aparicio
851acdd22d core: fix deprecated warnings 2018-09-22 21:01:21 +02:00
Corey Farwell
993fb93464 Replace usages of ptr::offset with ptr::{add,sub}. 2018-08-20 07:28:34 -04:00
Ralf Jung
16c057256f fix safety-related comment in slice::rotate 2018-07-19 09:11:56 +02:00
Scott McMurray
47fa016193 Reuse the mem::swap optimizations to speed up slice::rotate
Exposes the swapping logic from PR 40454 as `pub unsafe fn ptr::swap_nonoverlapping` under feature swap_nonoverlapping

This is most helpful for compound types where LLVM didn't vectorize the loop.  Highlight: bench slice::rotate_medium_by727_strings gets 38% faster.
2017-06-21 22:58:45 -07:00
Scott McMurray
59a6fe6e87 Remove the optimization in ptr_swap_n
It can be revisted later after the mem::swap optimizations land.
2017-05-21 01:55:43 -07:00
Scott McMurray
c05676b97f Add an in-place rotate method for slices to libcore
A helpful primitive for moving chunks of data around inside a slice.
In particular, adding elements to the end of a Vec then moving them
somewhere else, as a way to do efficient multiple-insert.  (There's
drain for efficient block-remove, but no easy way to block-insert.)

Talk with another example: <https://youtu.be/qH6sSOr-yk8?t=560>
2017-05-21 01:55:43 -07:00