rust/src
Alex Crichton 45bf1ed1a1 rustc: Allow changing the default allocator
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
2015-08-14 15:13:10 -07:00
..
compiler-rt@58ab642c30
compiletest Fix #27567: remove --crate-type=lib from pretty test 2015-08-11 13:00:38 +02:00
doc Fix broken link to Wilson 2015-08-13 15:42:14 -04:00
driver
error-index-generator diagnostics: Resurrect the Compiler Error Index. 2015-06-20 16:57:40 +10:00
etc Auto merge of #27684 - alexcrichton:remove-deprecated, r=aturon 2015-08-13 23:32:30 +00:00
grammar rustc: rename multiple imports in a list 2015-08-08 11:54:15 -07:00
jemalloc@e24a1a025a
liballoc rustc: Allow changing the default allocator 2015-08-14 15:13:10 -07:00
liballoc_jemalloc rustc: Allow changing the default allocator 2015-08-14 15:13:10 -07:00
liballoc_system rustc: Allow changing the default allocator 2015-08-14 15:13:10 -07:00
libarena rollup merge of #27622: eefriedman/https-url 2015-08-11 22:11:25 -07:00
libbacktrace 'iff' for docs to 'if and only if' 2015-07-08 21:17:13 -05:00
libcollections Auto merge of #27696 - bluss:into-boxed-str, r=alexcrichton 2015-08-14 01:06:37 +00:00
libcollectionstest Auto merge of #27696 - bluss:into-boxed-str, r=alexcrichton 2015-08-14 01:06:37 +00:00
libcore Auto merge of #27641 - nikomatsakis:soundness-rfc-1214, r=nrc 2015-08-14 15:26:09 +00:00
libcoretest Auto merge of #27786 - alexcrichton:start-testing-msvc, r=brson 2015-08-14 02:38:29 +00:00
libflate Use https URLs to refer to rust-lang.org where appropriate. 2015-08-09 14:28:46 -07:00
libfmt_macros Use https URLs to refer to rust-lang.org where appropriate. 2015-08-09 14:28:46 -07:00
libgetopts Remove all unstable deprecated functionality 2015-08-12 14:55:17 -07:00
libgraphviz Fallout in libs -- misc missing bounds uncovered by WF checks. 2015-08-12 17:58:56 -04:00
liblibc libc: Fix backcompat with crates.io version 2015-08-12 15:32:36 -07:00
liblog Correct debug! documentation 2015-08-12 19:19:31 -04:00
librand Fallout in libs -- misc missing bounds uncovered by WF checks. 2015-08-12 17:58:56 -04:00
librbml Use https URLs to refer to rust-lang.org where appropriate. 2015-08-09 14:28:46 -07:00
librustc rustc: Allow changing the default allocator 2015-08-14 15:13:10 -07:00
librustc_back rustc: Allow changing the default allocator 2015-08-14 15:13:10 -07:00
librustc_bitflags Remove all unstable deprecated functionality 2015-08-12 14:55:17 -07:00
librustc_borrowck Auto merge of #27758 - nathankleyn:diagnostics-386, r=Manishearth 2015-08-13 20:37:18 +00:00
librustc_data_structures Fallout in libs -- misc missing bounds uncovered by WF checks. 2015-08-12 17:58:56 -04:00
librustc_driver rustc: Allow changing the default allocator 2015-08-14 15:13:10 -07:00
librustc_lint Remove all unstable deprecated functionality 2015-08-12 14:55:17 -07:00
librustc_llvm rollup merge of #27678: alexcrichton/snapshots 2015-08-11 22:42:22 -07:00
librustc_privacy rollup merge of #27622: eefriedman/https-url 2015-08-11 22:11:25 -07:00
librustc_resolve Auto merge of #27698 - arielb1:foreign-type-import, r=alexcrichton 2015-08-12 22:42:12 +00:00
librustc_trans rustc: Allow changing the default allocator 2015-08-14 15:13:10 -07:00
librustc_typeck rustc: Allow changing the default allocator 2015-08-14 15:13:10 -07:00
librustc_unicode Remove all unstable deprecated functionality 2015-08-12 14:55:17 -07:00
librustdoc Auto merge of #27641 - nikomatsakis:soundness-rfc-1214, r=nrc 2015-08-14 15:26:09 +00:00
libserialize Auto merge of #27641 - nikomatsakis:soundness-rfc-1214, r=nrc 2015-08-14 15:26:09 +00:00
libstd rustc: Allow changing the default allocator 2015-08-14 15:13:10 -07:00
libsyntax rustc: Allow changing the default allocator 2015-08-14 15:13:10 -07:00
libterm Use https URLs to refer to rust-lang.org where appropriate. 2015-08-09 14:28:46 -07:00
libtest rollup merge of #27622: eefriedman/https-url 2015-08-11 22:11:25 -07:00
llvm@874dc4ee4c Update LLVM 2015-07-16 20:25:51 -07:00
rt Register new snapshots 2015-08-11 15:11:13 -07:00
rust-installer@c37d3747da Fix error message spans 2015-07-25 19:57:59 -07:00
rustbook Use https URLs to refer to rust-lang.org where appropriate. 2015-08-09 14:28:46 -07:00
rustllvm Remove morestack support 2015-08-10 16:35:44 -07:00
test rustc: Allow changing the default allocator 2015-08-14 15:13:10 -07:00
snapshots.txt Fixes #27805 - adds missing snapshots for Bitrig and FreeBSD 2015-08-13 13:45:04 -07:00