rust/mk
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
..
cfg Register new snapshots 2015-08-11 15:11:13 -07:00
clean.mk Remove morestack support 2015-08-10 16:35:44 -07:00
crates.mk rustc: Allow changing the default allocator 2015-08-14 15:13:10 -07:00
ctags.mk Update the ctags rules and targets. 2015-07-30 06:35:42 +10:00
debuggers.mk debuginfo: Create common debugger pretty printer module. 2015-05-30 20:06:08 +02:00
dist.mk mk: Don't build compiler-docs before installation. #25699 2015-05-22 13:02:52 -07:00
docs.mk Auto merge of #27789 - chriskrycho:remove_pandoc_references, r=steveklabnik 2015-08-13 03:52:10 +00:00
grammar.mk Add a LALR grammar for Rust with testing support 2015-01-20 18:47:17 -08:00
host.mk
install.mk configure: Remove obsolete --disable-verify option 2015-04-08 12:16:47 -07:00
llvm.mk mk: Add the ability to depend on native LLVM tools 2015-05-19 10:53:04 -07:00
main.mk Register new snapshots 2015-08-11 15:11:13 -07:00
perf.mk
platform.mk Register new snapshots 2015-08-11 15:11:13 -07:00
prepare.mk Replace nop hack, explain substitution reasoning 2015-06-13 17:27:12 +01:00
reconfig.mk mk: Fix reconfiguring top-level ./configure 2015-06-17 17:32:11 -07:00
rt.mk rustc: Allow changing the default allocator 2015-08-14 15:13:10 -07:00
rustllvm.mk trans: Use LLVM's writeArchive to modify archives 2015-07-10 09:06:21 -07:00
snap.mk
stage0.mk mk/stage0: complain instead of creating an empty file 2014-11-20 16:00:12 -05:00
target.mk Register new snapshots 2015-08-11 15:11:13 -07:00
tests.mk rustc: Allow changing the default allocator 2015-08-14 15:13:10 -07:00
util.mk mk: Build crates with relative paths to rustc 2015-06-13 01:41:52 +02:00