rust/src/libstd
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
..
collections Auto merge of #27822 - arielb1:inline-round-take-2, r=Gankro 2015-08-14 07:11:07 +00:00
ffi Remove all unstable deprecated functionality 2015-08-12 14:55:17 -07:00
io Remove all unstable deprecated functionality 2015-08-12 14:55:17 -07:00
net Remove all unstable deprecated functionality 2015-08-12 14:55:17 -07:00
num Remove all unstable deprecated functionality 2015-08-12 14:55:17 -07:00
os Fixes #25155 and fixes #27359 by fixing the stat defines for both freebsd 10.1 x86_64 and i686 2015-07-28 11:10:23 -07:00
prelude doc: prelude nits 2015-07-30 10:45:00 +02:00
rand rollup merge of #27678: alexcrichton/snapshots 2015-08-11 22:42:22 -07:00
rt Remove all unstable deprecated functionality 2015-08-12 14:55:17 -07:00
sync Auto merge of #27641 - nikomatsakis:soundness-rfc-1214, r=nrc 2015-08-14 15:26:09 +00:00
sys Auto merge of #27684 - alexcrichton:remove-deprecated, r=aturon 2015-08-13 23:32:30 +00:00
thread Auto merge of #27641 - nikomatsakis:soundness-rfc-1214, r=nrc 2015-08-14 15:26:09 +00:00
time Remove all unstable deprecated functionality 2015-08-12 14:55:17 -07:00
ascii.rs Remove all unstable deprecated functionality 2015-08-12 14:55:17 -07:00
dynamic_lib.rs Add netbsd amd64 support 2015-07-01 19:09:14 -07:00
env.rs Remove all unstable deprecated functionality 2015-08-12 14:55:17 -07:00
error.rs Replace many uses of mem::transmute with more specific functions 2015-08-09 22:05:22 +02:00
fs.rs Remove all unstable deprecated functionality 2015-08-12 14:55:17 -07:00
lib.rs rustc: Allow changing the default allocator 2015-08-14 15:13:10 -07:00
macros.rs Show appropriate feature flags in docs 2015-07-27 12:28:13 -04:00
panicking.rs Fix logic in panic printing with no stderr 2015-06-20 19:54:15 -07:00
path.rs rollup merge of #27678: alexcrichton/snapshots 2015-08-11 22:42:22 -07:00
primitive_docs.rs Show appropriate feature flags in docs 2015-07-27 12:28:13 -04:00
process.rs syntax: Don't assume std exists for tests 2015-08-04 14:02:36 -07:00
rtdeps.rs Auto merge of #26741 - alexcrichton:noinline-destructors, r=brson 2015-07-06 19:49:16 +00:00