]> git.proxmox.com Git - rustc.git/blame - src/librustc_allocator/lib.rs
New upstream version 1.34.2+dfsg1
[rustc.git] / src / librustc_allocator / lib.rs
CommitLineData
0bf4aa26 1#![feature(nll)]
041b39d2
XL
2#![feature(rustc_private)]
3
9fa01778 4#![deny(rust_2018_idioms)]
041b39d2
XL
5
6pub mod expand;
7
8pub static ALLOCATOR_METHODS: &[AllocatorMethod] = &[
9 AllocatorMethod {
10 name: "alloc",
11 inputs: &[AllocatorTy::Layout],
12 output: AllocatorTy::ResultPtr,
041b39d2 13 },
041b39d2
XL
14 AllocatorMethod {
15 name: "dealloc",
16 inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout],
17 output: AllocatorTy::Unit,
041b39d2 18 },
041b39d2
XL
19 AllocatorMethod {
20 name: "realloc",
83c7162d 21 inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout, AllocatorTy::Usize],
041b39d2 22 output: AllocatorTy::ResultPtr,
041b39d2
XL
23 },
24 AllocatorMethod {
25 name: "alloc_zeroed",
26 inputs: &[AllocatorTy::Layout],
27 output: AllocatorTy::ResultPtr,
041b39d2 28 },
041b39d2
XL
29];
30
31pub struct AllocatorMethod {
32 pub name: &'static str,
33 pub inputs: &'static [AllocatorTy],
34 pub output: AllocatorTy,
041b39d2
XL
35}
36
37pub enum AllocatorTy {
041b39d2 38 Layout,
041b39d2 39 Ptr,
041b39d2 40 ResultPtr,
041b39d2 41 Unit,
83c7162d 42 Usize,
041b39d2 43}