From 6fb11a5af19b91557dba1ca853599596622f56df Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 30 Dec 2018 07:36:38 +0800 Subject: Codegen C - Add hacky compiler-provided glue --- src/trans/allocator.hpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/trans/allocator.hpp') diff --git a/src/trans/allocator.hpp b/src/trans/allocator.hpp index 8a4e5186..c124ef57 100644 --- a/src/trans/allocator.hpp +++ b/src/trans/allocator.hpp @@ -9,17 +9,12 @@ enum class AllocatorDataTy { // - Return - Never, // ! Unit, // () ResultPtr, // (..., *mut i8) + *mut u8 - ResultExcess, // (..., *mut i8, *mut i8) + *mut u8 - UsizePair, // (..., *mut usize, *mut usize) + () - ResultUnit, // i8 // - Args Layout, // usize, usize - LayoutRef, // *const Layout [actually *const i8] - AllocError, // *const i8 Ptr, // *mut u8 + Usize, // usize }; struct AllocatorMethod { const char* name; @@ -33,5 +28,6 @@ enum class AllocatorKind { DefaultExe, }; -extern const AllocatorMethod ALLOCATOR_METHODS[10]; +extern const AllocatorMethod ALLOCATOR_METHODS[]; +extern const size_t NUM_ALLOCATOR_METHODS; -- cgit v1.2.3