1 use rustc_span::symbol::{sym, Symbol};
3 #[derive(Clone, Debug, Copy, HashStable_Generic)]
4 pub enum AllocatorKind {
10 pub fn fn_name(&self, base: Symbol) -> String {
12 AllocatorKind::Global => format!("__rg_{base}"),
13 AllocatorKind::Default => format!("__rdl_{base}"),
18 pub enum AllocatorTy {
26 pub struct AllocatorMethod {
28 pub inputs: &'static [AllocatorTy],
29 pub output: AllocatorTy,
32 pub static ALLOCATOR_METHODS: &[AllocatorMethod] = &[
35 inputs: &[AllocatorTy::Layout],
36 output: AllocatorTy::ResultPtr,
40 inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout],
41 output: AllocatorTy::Unit,
45 inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout, AllocatorTy::Usize],
46 output: AllocatorTy::ResultPtr,
49 name: sym::alloc_zeroed,
50 inputs: &[AllocatorTy::Layout],
51 output: AllocatorTy::ResultPtr,