name: "alloc",
inputs: &[AllocatorTy::Layout],
output: AllocatorTy::ResultPtr,
- is_unsafe: true,
- },
- AllocatorMethod {
- name: "oom",
- inputs: &[AllocatorTy::AllocErr],
- output: AllocatorTy::Bang,
- is_unsafe: false,
},
AllocatorMethod {
name: "dealloc",
inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout],
output: AllocatorTy::Unit,
- is_unsafe: true,
- },
- AllocatorMethod {
- name: "usable_size",
- inputs: &[AllocatorTy::LayoutRef],
- output: AllocatorTy::UsizePair,
- is_unsafe: false,
},
AllocatorMethod {
name: "realloc",
- inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout, AllocatorTy::Layout],
+ inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout, AllocatorTy::Usize],
output: AllocatorTy::ResultPtr,
- is_unsafe: true,
},
AllocatorMethod {
name: "alloc_zeroed",
inputs: &[AllocatorTy::Layout],
output: AllocatorTy::ResultPtr,
- is_unsafe: true,
- },
- AllocatorMethod {
- name: "alloc_excess",
- inputs: &[AllocatorTy::Layout],
- output: AllocatorTy::ResultExcess,
- is_unsafe: true,
- },
- AllocatorMethod {
- name: "realloc_excess",
- inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout, AllocatorTy::Layout],
- output: AllocatorTy::ResultExcess,
- is_unsafe: true,
- },
- AllocatorMethod {
- name: "grow_in_place",
- inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout, AllocatorTy::Layout],
- output: AllocatorTy::ResultUnit,
- is_unsafe: true,
- },
- AllocatorMethod {
- name: "shrink_in_place",
- inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout, AllocatorTy::Layout],
- output: AllocatorTy::ResultUnit,
- is_unsafe: true,
},
];
pub name: &'static str,
pub inputs: &'static [AllocatorTy],
pub output: AllocatorTy,
- pub is_unsafe: bool,
}
pub enum AllocatorTy {
- AllocErr,
- Bang,
Layout,
- LayoutRef,
Ptr,
- ResultExcess,
ResultPtr,
- ResultUnit,
Unit,
- UsizePair,
+ Usize,
}