summary refs log tree commit diff
path: root/src/liballoc_system
AgeCommit message (Collapse)AuthorLines
2017-09-10Autodetect the type of allocator crate usedMichal 'vorner' Vaner-0/+3
Annotate the allocator crates (allocator_system, allocator_jemalloc) by the type of allocator they are. If one is requested as an exe allocator, detect its type by the flags. This has the effect that using this (de jure wrong) configuration in the target spec works instead of producing a really unhelpful and arcane linker error: "exe-allocation-crate": "alloc_system" Fixes #43524.
2017-09-06Use memalign instead of posix_memalign for Solarisbgermann-2/+2
As pointed out in https://github.com/rust-lang/libc/commit/deb61c8, Solaris 10 does not support posix_memalign. Use memalign for all Solaris versions instead. With this change applied I am able to cross-build rustc for Solaris 10.
2017-08-25*: remove crate_{name,type} attributesTamir Duberstein-2/+0
Fixes #41701.
2017-07-25Bump master to 1.21.0Alex Crichton-352/+69
This commit bumps the master branch's version to 1.21.0 and also updates the bootstrap compiler from the freshly minted beta release.
2017-07-05rustc: Implement the #[global_allocator] attributeAlex Crichton-142/+608
This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/197 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
2017-06-02Improve reallocation in alloc_system on WindowsPeter Atashian-17/+20
2017-04-15Specialize Vec::from_elem<u8> to use calloc or memsetMatt Brubeck-3/+31
Fixes #38723.
2017-01-08Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrcbors-1/+1
Remove not(stage0) from deny(warnings) Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2017-01-01Merge branch 'master' into sparc64Seo Sanghyeon-0/+1
2016-12-30std: Don't build docs for misc facade cratesAlex Crichton-0/+1
Retain the same behavior as stable. Closes #38319
2016-12-29Remove not(stage0) from deny(warnings)Alex Crichton-1/+1
Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2016-12-29liballoc_*: add MIN_ALIGN for sparc64Jonathan A. Kollasch-1/+2
2016-12-20Switch back to alloc_systemJeremy Soller-47/+4
2016-12-15WIP: Cross-compilation for Redox targetJeremy Soller-1/+44
2016-10-25Print out the error when HeapFree failures do occurPeter Atashian-2/+3
2016-10-16run rustfmt on various foldersSrinivas Reddy Thatiparthy-5/+1
2016-09-30Preliminary wasm32 supportBrian Anderson-1/+2
2016-09-09Add s390x supportUlrich Weigand-1/+2
This adds support for building the Rust compiler and standard library for s390x-linux, allowing a full cross-bootstrap sequence to complete. This includes: - Makefile/configure changes to allow native s390x builds - Full Rust compiler support for the s390x C ABI (only the non-vector ABI is supported at this point) - Port of the standard library to s390x - Update the liblibc submodule to a version including s390x support - Testsuite fixes to allow clean "make check" on s390x Caveats: - Resets base cpu to "z10" to bring support in sync with the default behaviour of other compilers on the platforms. (Usually, upstream supports all older processors; a distribution build may then chose to require a more recent base version.) (Also, using zEC12 causes failures in the valgrind tests since valgrind doesn't fully support this CPU yet.) - z13 vector ABI is not yet supported. To ensure compatible code generation, the -vector feature is passed to LLVM. Note that this means that even when compiling for z13, no vector instructions will be used. In the future, support for the vector ABI should be added (this will require common code support for different ABIs that need different data_layout strings on the same platform). - Two test cases are (temporarily) ignored on s390x to allow passing the test suite. The underlying issues still need to be fixed: * debuginfo/simd.rs fails because of incorrect debug information. This seems to be a LLVM bug (also seen with C code). * run-pass/union/union-basic.rs simply seems to be incorrect for all big-endian platforms. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-08-27fix cross compilation of stdJorge Aparicio-1/+2
2016-05-24std: Use memalign, not posix_memalign, on AndroidAlex Crichton-7/+34
We've gotten requests to move our Android support as far back as API level 9 where unfortunately the `posix_memalign` API wasn't implemented yet. Thankfully, however, the `memalign` API was and it appears to be usable with `free` on the Android platform (see comments included in commit). This should help fix some of the last few test failures when compiling against API level 9.
2016-05-09rustc: Implement custom panic runtimesAlex Crichton-4/+3
This commit is an implementation of [RFC 1513] which allows applications to alter the behavior of panics at compile time. A new compiler flag, `-C panic`, is added and accepts the values `unwind` or `panic`, with the default being `unwind`. This model affects how code is generated for the local crate, skipping generation of landing pads with `-C panic=abort`. [RFC 1513]: https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md Panic implementations are then provided by crates tagged with `#![panic_runtime]` and lazily required by crates with `#![needs_panic_runtime]`. The panic strategy (`-C panic` value) of the panic runtime must match the final product, and if the panic strategy is not `abort` then the entire DAG must have the same panic strategy. With the `-C panic=abort` strategy, users can expect a stable method to disable generation of landing pads, improving optimization in niche scenarios, decreasing compile time, and decreasing output binary size. With the `-C panic=unwind` strategy users can expect the existing ability to isolate failure in Rust code from the outside world. Organizationally, this commit dismantles the `sys_common::unwind` module in favor of some bits moving part of it to `libpanic_unwind` and the rest into the `panicking` module in libstd. The custom panic runtime support is pretty similar to the custom allocator support with the only major difference being how the panic runtime is injected (takes the `-C panic` flag into account).
2016-04-15alloc_system: Handle failure properlyAlex Crichton-2/+4
The Unix implementation was incorrectly handling failure for reallocation of over-aligned types by not checking for NULL. Closes #32993
2016-02-11bootstrap: Add a bunch of Cargo.toml filesAlex Crichton-0/+13
These describe the structure of all our crate dependencies.
2016-02-06Add the asmjs-unknown-emscripten triple. Add cfgs to libs.Brian Anderson-1/+2
Backtraces, and the compilation of libbacktrace for asmjs, are disabled. This port doesn't use jemalloc so, like pnacl, it disables jemalloc *for all targets* in the configure file. It disables stack protection.
2016-02-01Remove "powerpc64le" and "mipsel" target_archAlex Crichton-3/+1
Currently the `mipsel-unknown-linux-gnu` target doesn't actually set the `target_arch` value to `mipsel` but it rather uses `mips`. Alternatively the `powerpc64le` target does indeed set the `target_arch` as `powerpc64le`, causing a bit of inconsistency between theset two. As these are just the same instance of one instruction set, let's use `target_endian` to switch between them and only set the `target_arch` as one value. This should cut down on the number of `#[cfg]` annotations necessary and all around be a little more ergonomic.
2016-01-24mk: Move from `-D warnings` to `#![deny(warnings)]`Alex Crichton-0/+1
This commit removes the `-D warnings` flag being passed through the makefiles to all crates to instead be a crate attribute. We want these attributes always applied for all our standard builds, and this is more amenable to Cargo-based builds as well. Note that all `deny(warnings)` attributes are gated with a `cfg(stage0)` attribute currently to match the same semantics we have today
2016-01-13Add powerpc64 and powerpc64le supportAnton Blanchard-1/+3
This adds support for big endian and little endian PowerPC64. make check runs clean apart from one big endian backtrace issue.
2016-01-12android has `posix_memalign` for API 16+ since NDK r10dTamir Duberstein-26/+6
See: http://developer.android.com/ndk/downloads/revision_history.html Also, use `libc`'s `posix_memalign`.
2015-12-21Register new snapshotsAlex Crichton-5/+1
Lots of cruft to remove!
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-1/+1
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-12-02MIN_ALIGN is definitely 8 on 32-bit x86, at least on Windows.Peter Atashian-3/+3
Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-11-26Auto merge of #30015 - petrochenkov:staged, r=brsonbors-1/+1
Closes https://github.com/rust-lang/rust/issues/30008 `#[stable]`, `#[unstable]` and `#[rustc_deprecated]` are now guarded by `#[feature(staged_api)]` r? @brson
2015-11-25Remove all uses of `#[staged_api]`Vadim Petrochenkov-1/+1
2015-11-24rustfmt: liballoc, liballoc_*, libarenaNick Cameron-3/+3
2015-11-09std: Migrate to the new libcAlex Crichton-1/+8
* Delete `sys::unix::{c, sync}` as these are now all folded into libc itself * Update all references to use `libc` as a result. * Update all references to the new flat namespace. * Moves all windows bindings into sys::c
2015-10-11Run rustfmt on liballoc_system.Ahmed Charles-29/+48
2015-08-15test: Fix tests for requiring issuesAlex Crichton-1/+2
2015-08-14rustc: Allow changing the default allocatorAlex Crichton-0/+212
This commit is an implementation of [RFC 1183][rfc] which allows swapping out the default allocator on nightly Rust. No new stable surface area should be added as a part of this commit. [rfc]: https://github.com/rust-lang/rfcs/pull/1183 Two new attributes have been added to the compiler: * `#![needs_allocator]` - this is used by liballoc (and likely only liballoc) to indicate that it requires an allocator crate to be in scope. * `#![allocator]` - this is a indicator that the crate is an allocator which can satisfy the `needs_allocator` attribute above. The ABI of the allocator crate is defined to be a set of symbols that implement the standard Rust allocation/deallocation functions. The symbols are not currently checked for exhaustiveness or typechecked. There are also a number of restrictions on these crates: * An allocator crate cannot transitively depend on a crate that is flagged as needing an allocator (e.g. allocator crates can't depend on liballoc). * There can only be one explicitly linked allocator in a final image. * If no allocator is explicitly requested one will be injected on behalf of the compiler. Binaries and Rust dylibs will use jemalloc by default where available and staticlibs/other dylibs will use the system allocator by default. Two allocators are provided by the distribution by default, `alloc_system` and `alloc_jemalloc` which operate as advertised. Closes #27389