summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-05-12register snapshotsDaniel Micay-84/+2
2014-05-11auto merge of #14119 : thestinger/rust/heap, r=cmrbors-24/+33
2014-05-11auto merge of #14110 : SSheldon/rust/strbuf_mutable, r=alexcrichtonbors-1/+17
Despite implementing the Container trait, StrBuf did not implement the Mutable trait and had no clear method; this request implements the clear method of the Mutable trait for StrBuf. Testing done: added a test and ran `make check` without any failures.
2014-05-11heap: replace `exchange_free` with `deallocate`Daniel Micay-17/+12
The `std::rt::heap` API is Rust's global allocator, so there's no need to have this as a separate API.
2014-05-11heap: add a way to print allocator statisticsDaniel Micay-2/+16
2014-05-11mark rust_malloc/rust_free as unsafeDaniel Micay-6/+6
Support for this was added by 08237cad8d2ce9287aedf99e57384407cc9dc42d.
2014-05-11sync::deque: port to the new allocator APIDaniel Micay-15/+19
2014-05-11Implement Mutable trait for StrBuf.Steven Sheldon-1/+17
2014-05-11core: Remove the cast moduleAlex Crichton-253/+258
This commit revisits the `cast` module in libcore and libstd, and scrutinizes all functions inside of it. The result was to remove the `cast` module entirely, folding all functionality into the `mem` module. Specifically, this is the fate of each function in the `cast` module. * transmute - This function was moved to `mem`, but it is now marked as #[unstable]. This is due to planned changes to the `transmute` function and how it can be invoked (see the #[unstable] comment). For more information, see RFC 5 and #12898 * transmute_copy - This function was moved to `mem`, with clarification that is is not an error to invoke it with T/U that are different sizes, but rather that it is strongly discouraged. This function is now #[stable] * forget - This function was moved to `mem` and marked #[stable] * bump_box_refcount - This function was removed due to the deprecation of managed boxes as well as its questionable utility. * transmute_mut - This function was previously deprecated, and removed as part of this commit. * transmute_mut_unsafe - This function doesn't serve much of a purpose when it can be achieved with an `as` in safe code, so it was removed. * transmute_lifetime - This function was removed because it is likely a strong indication that code is incorrect in the first place. * transmute_mut_lifetime - This function was removed for the same reasons as `transmute_lifetime` * copy_lifetime - This function was moved to `mem`, but it is marked `#[unstable]` now due to the likelihood of being removed in the future if it is found to not be very useful. * copy_mut_lifetime - This function was also moved to `mem`, but had the same treatment as `copy_lifetime`. * copy_lifetime_vec - This function was removed because it is not used today, and its existence is not necessary with DST (copy_lifetime will suffice). In summary, the cast module was stripped down to these functions, and then the functions were moved to the `mem` module. transmute - #[unstable] transmute_copy - #[stable] forget - #[stable] copy_lifetime - #[unstable] copy_mut_lifetime - #[unstable] [breaking-change]
2014-05-11android workaroundDaniel Micay-1/+1
2014-05-10rename `global_heap` -> `libc_heap`Daniel Micay-10/+9
This module only contains wrappers for malloc and realloc with out-of-memory checks.
2014-05-10vec: factor out some deallocation codeDaniel Micay-9/+12
2014-05-10vec: move some code inside alloc_or_reallocDaniel Micay-7/+5
2014-05-10fix Vec<ZeroSizeType>Daniel Micay-2/+15
2014-05-10initial port of the exchange allocator to jemallocDaniel Micay-142/+205
In stage0, all allocations are 8-byte aligned. Passing a size and alignment to free is not yet implemented everywhere (0 size and 8 align are used as placeholders). Fixing this is part of #13994. Closes #13616
2014-05-10use jemalloc to implement Vec<T>Daniel Micay-27/+49
2014-05-10add an align parameter to exchange_mallocDaniel Micay-1/+44
Closes #13094
2014-05-10add back jemalloc to the treeDaniel Micay-1/+101
This adds a `std::rt::heap` module with a nice allocator API. It's a step towards fixing #13094 and is a starting point for working on a generic allocator trait. The revision used for the jemalloc submodule is the stable 3.6.0 release. Closes #11807
2014-05-10auto merge of #14073 : alexcrichton/rust/snapshots, r=huonwbors-42/+5
2014-05-10auto merge of #14068 : alexcrichton/rust/rustdoc-xcrate-links, r=brsonbors-8/+8
This should improve the libcore experience quite a bit when looking at the libstd documentation.
2014-05-09Register new snapshotsAlex Crichton-42/+5
2014-05-09doc: Fix some broken linksAlex Crichton-8/+8
2014-05-09auto merge of #14054 : luqmana/rust/at, r=alexcrichtonbors-7/+9
`/data/local/tmp` seems to be more common.
2014-05-09auto merge of #14046 : alexcrichton/rust/ignore-a-test-on-freebsd, r=kballardbors-13/+18
This test runs successfully manually, but the bots are having trouble getting this test to pass. Ignore it on freebsd for now.
2014-05-09auto merge of #14035 : alexcrichton/rust/experimental, r=huonwbors-0/+9
This was intended as part of the I/O timeouts commit, but it was mistakenly forgotten. The type of the timeout argument is not guaranteed to remain constant into the future.
2014-05-08auto merge of #14019 : brson/rust/docs, r=alexcrichtonbors-3/+4
Just small bits of polish.
2014-05-08auto merge of #13963 : kballard/rust/remove_owned_vec_from_iterator, r=pcwaltonbors-418/+510
With `~[T]` no longer growable, the `FromIterator` impl for `~[T]` doesn't make much sense. Not only that, but nearly everywhere it is used is to convert from a `Vec<T>` into a `~[T]`, for the sake of maintaining existing APIs. This turns out to be a performance loss, as it means every API that returns `~[T]`, even a supposedly non-copying one, is in fact doing extra allocations and memcpy's. Even `&[T].to_owned()` is going through `Vec<T>` first. Remove the `FromIterator` impl for `~[T]`, and adjust all the APIs that relied on it to start using `Vec<T>` instead. This includes rewriting `&[T].to_owned()` to be more efficient, among other performance wins. Also add a new mechanism to go from `Vec<T>` -> `~[T]`, just in case anyone truly needs that, using the new trait `FromVec`. [breaking-change]
2014-05-08libstd: Check TMPDIR for android as well and if not set use ↵Luqman Aden-7/+9
'/data/local/tmp' instead of '/data/tmp'.
2014-05-08auto merge of #13985 : alexcrichton/rust/libfmt, r=brsonbors-1009/+80
This code does not belong in libstd, and rather belongs in a dedicated crate. In the future, the syntax::ext::format module should move to the fmt_macros crate (hence the name of the crate), but for now the fmt_macros crate will only contain the format string parser. The entire fmt_macros crate is marked #[experimental] because it is not meant for general consumption, only the format!() interface is officially supported, not the internals. This is a breaking change for anyone using the internals of std::fmt::parse. Some of the flags have moved to std::fmt::rt, while the actual parsing support has all moved to the fmt_macros library. [breaking-change]
2014-05-08Move partition/partitioned/concat/connect tests back into sliceKevin Ballard-26/+40
There was no reason to remove them from slice. They're testing methods defined in slice, so that's where they belong. Leave vec with copies of the partition/partitioned tests because it has its own implementation of those methods.
2014-05-08Handle breakage after libcore splitKevin Ballard-55/+28
API Changes: - &[T] and ~[T] no longer support the addition operator (+)
2014-05-08Add a mechanism to convert from Vec<T> to ~[T]Kevin Ballard-1/+73
Add a new trait FromVec with one self-less method from_vec(). This is kind of like FromIterator, but it consumes a Vec<T>. It's only implemented for ~[T], but the idea is post-DST it can be implemented for any Boxed<[T]>.
2014-05-08Handle fallout in documentationKevin Ballard-1/+1
Tweak the tutorial's section on vectors and strings, to slightly clarify the difference between fixed-size vectors, vectors, and slices.
2014-05-08Handle more falloutKevin Ballard-0/+3
os::args() no longer auto-borrows to &[~str].
2014-05-08Clean up unused importsKevin Ballard-12/+5
2014-05-08Handle fallout in libnativeKevin Ballard-1/+1
API Changes: - GetAddrInfoRequest::run() returns Result<Vec<..>, ..> - Process::spawn() returns Result(.., Vec<..>), ..>
2014-05-08Handle fallout for vector additionKevin Ballard-3/+38
Adding two vectors now results in a Vec<T> instead of a ~[T]. Implement Add on Vec<T>.
2014-05-08Handle fallout in io::net::addrinfo, io::process, and rt::rtioKevin Ballard-6/+6
API Changes: - get_host_addresses() returns IoResult<Vec<IpAddr>> - Process.extra_io is Vec<Option<io::PipeStream>>
2014-05-08Handle fallout in osKevin Ballard-44/+47
os::env(), os::args(), and related functions now use Vec<T> instead of ~[T].
2014-05-08Handle fallout in iter, option, result, and sync::arcKevin Ballard-3/+3
API changes: - UnsafeArc::newN() returns Vec<UnsafeArc<T>>
2014-05-08Handle fallout in std::ascii and std::strconvKevin Ballard-46/+59
API changes: - OwnedAsciiCast returns Vec<Ascii> instead of ~[Ascii] - OwnedAsciiCast is implemented on Vec<u8> - AsciiStr.to_lower/upper() returns Vec<Ascii> - IntoBytes::into_bytes() returns Vec<u8> - float_to_str_bytes_common() returns (Vec<u8>, bool)
2014-05-08Handle fallout in std::strbufKevin Ballard-5/+2
2014-05-08Even more fallout, this time in std::strKevin Ballard-92/+85
- StrSlice.to_utf16() now returns a Vec<u8>. - Other miscellaneous fallout in std::str.
2014-05-08More fallout from removing FromIterator on ~[T]Kevin Ballard-42/+42
2014-05-08Move slice::raw::from_buf_raw() to vec::raw::from_buf()Kevin Ballard-56/+36
Change from_buf_raw() to return a Vec<T> instead of a ~[T]. As such, it belongs in vec, in the newly-created vec::raw module.
2014-05-08Rename slice::unzip() to vec::unzip()Kevin Ballard-33/+35
unzip() has nothing to do with slices, so it belongs in vec.
2014-05-08More fallout from removing FromIterator on ~[T]Kevin Ballard-57/+57
A few methods in slice that used to return ~[T] now return Vec<T>: - VectorVector.concat/connect_vec() returns Vec<T> - slice::unzip() returns (Vec<T>, Vec<U>) - ImmutableCloneableVector.partitioned() returns (Vec<T>, Vec<T>) - OwnedVector.partition() returns (Vec<T>, Vec<T>)
2014-05-08Rewrite &[T].to_owned() to allocate directlyKevin Ballard-9/+23
This used to create a Vec<T> and then call .move_iter().collect() to convert to a ~[T]. We can't do that anymore, so construct the ~[T] in place instead. This has the added benefit of avoiding an unnecessary memory copy (from the Vec<T> to the ~[T]).
2014-05-08std: Ignore a flaky test on freebsdAlex Crichton-13/+18
This test runs successfully manually, but the bots are having trouble getting this test to pass. Ignore it on freebsd for now.
2014-05-08std: Extract format string parsing out of libstdAlex Crichton-1009/+80
This code does not belong in libstd, and rather belongs in a dedicated crate. In the future, the syntax::ext::format module should move to the fmt_macros crate (hence the name of the crate), but for now the fmt_macros crate will only contain the format string parser. The entire fmt_macros crate is marked #[experimental] because it is not meant for general consumption, only the format!() interface is officially supported, not the internals. This is a breaking change for anyone using the internals of std::fmt::parse. Some of the flags have moved to std::fmt::rt, while the actual parsing support has all moved to the fmt_macros library. [breaking-change]