]>
Commit | Line | Data |
---|---|---|
041b39d2 XL |
1 | // Copyright 2016 The Rust Project Developers. See the COPYRIGHT |
2 | // file at the top-level directory of this distribution and at | |
3 | // http://rust-lang.org/COPYRIGHT. | |
4 | // | |
5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
8 | // option. This file may not be copied, modified, or distributed | |
9 | // except according to those terms. | |
10 | ||
11 | #![feature(rustc_private)] | |
12 | ||
94b46f34 | 13 | #[macro_use] extern crate log; |
041b39d2 XL |
14 | extern crate rustc; |
15 | extern crate rustc_errors; | |
83c7162d | 16 | extern crate rustc_target; |
041b39d2 XL |
17 | extern crate syntax; |
18 | extern crate syntax_pos; | |
19 | ||
20 | pub mod expand; | |
21 | ||
22 | pub static ALLOCATOR_METHODS: &[AllocatorMethod] = &[ | |
23 | AllocatorMethod { | |
24 | name: "alloc", | |
25 | inputs: &[AllocatorTy::Layout], | |
26 | output: AllocatorTy::ResultPtr, | |
041b39d2 | 27 | }, |
041b39d2 XL |
28 | AllocatorMethod { |
29 | name: "dealloc", | |
30 | inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout], | |
31 | output: AllocatorTy::Unit, | |
041b39d2 | 32 | }, |
041b39d2 XL |
33 | AllocatorMethod { |
34 | name: "realloc", | |
83c7162d | 35 | inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout, AllocatorTy::Usize], |
041b39d2 | 36 | output: AllocatorTy::ResultPtr, |
041b39d2 XL |
37 | }, |
38 | AllocatorMethod { | |
39 | name: "alloc_zeroed", | |
40 | inputs: &[AllocatorTy::Layout], | |
41 | output: AllocatorTy::ResultPtr, | |
041b39d2 | 42 | }, |
041b39d2 XL |
43 | ]; |
44 | ||
45 | pub struct AllocatorMethod { | |
46 | pub name: &'static str, | |
47 | pub inputs: &'static [AllocatorTy], | |
48 | pub output: AllocatorTy, | |
041b39d2 XL |
49 | } |
50 | ||
51 | pub enum AllocatorTy { | |
041b39d2 | 52 | Layout, |
041b39d2 | 53 | Ptr, |
041b39d2 | 54 | ResultPtr, |
041b39d2 | 55 | Unit, |
83c7162d | 56 | Usize, |
041b39d2 | 57 | } |