rust/src/libsyntax
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
..
diagnostics Introduce a "origin/cause" for new requirements (or bugfixes...) introduced by RFC 1214, 2015-08-12 17:58:22 -04:00
ext Auto merge of #27691 - jonas-schievink:for-macro, r=alexcrichton 2015-08-12 20:58:31 +00:00
parse syntax: fix use of "vector" for [x; n] literal and [x, y] patterns 2015-08-11 17:41:06 +02:00
print Auto merge of #27451 - seanmonstar:use-groups-as, r=alexcrichton 2015-08-10 20:24:06 +00:00
util syntax: replace sess.span_diagnostic.cm with sess.codemap(). 2015-05-14 01:47:56 +03:00
abi.rs Add netbsd amd64 support 2015-07-01 19:09:14 -07:00
ast.rs Add two new kinds of predicates, WellFormed and ObjectSafe. 2015-08-12 17:57:57 -04:00
ast_util.rs remove get_ident and get_name, make as_str sound 2015-07-28 18:07:20 +02:00
attr.rs Remove all unstable deprecated functionality 2015-08-12 14:55:17 -07:00
codemap.rs add and use Span.substitute_dummy method 2015-08-10 20:43:11 +02:00
config.rs syntax: Remove uses of #[feature(slice_patterns)] 2015-04-21 10:08:26 -07:00
diagnostic.rs Auto merge of #26846 - P1start:print-maybe-styled-macro, r=pnkfelix 2015-07-29 00:28:55 +00:00
feature_gate.rs rustc: Allow changing the default allocator 2015-08-14 15:13:10 -07:00
fold.rs Auto merge of #27451 - seanmonstar:use-groups-as, r=alexcrichton 2015-08-10 20:24:06 +00:00
lib.rs Remove all unstable deprecated functionality 2015-08-12 14:55:17 -07:00
owned_slice.rs Switched to Box::new in many places. 2015-03-03 21:05:55 +01:00
ptr.rs syntax: remove #![feature(box_syntax, box_patterns)] 2015-04-21 10:07:48 -07:00
show_span.rs std: Stabilize FromStr and parse 2015-01-30 08:52:44 -08:00
std_inject.rs syntax: Implement #![no_core] 2015-08-03 17:23:01 -07:00
str.rs syntax: Copy unstable str::char_at into libsyntax 2015-04-21 10:23:53 -07:00
test.rs syntax: Don't assume std exists for tests 2015-08-04 14:02:36 -07:00
visit.rs Auto merge of #27451 - seanmonstar:use-groups-as, r=alexcrichton 2015-08-10 20:24:06 +00:00