diff options
author | John Hodge <tpg@ucc.asn.au> | 2019-11-02 11:07:23 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2019-11-02 11:07:23 +0800 |
commit | 1d02810c3cf908bfba7c15ae50eb5314603b9d85 (patch) | |
tree | 79dd5e4ef4c3ff79db0912ba546f08e61a7a8c10 /src/trans/allocator.cpp | |
parent | 7111acba04d72fe4084b1a1f3209ff83efe8614d (diff) | |
parent | 8b53b38f40625ab0510f541d69db3f83332a830a (diff) | |
download | mrust-1d02810c3cf908bfba7c15ae50eb5314603b9d85.tar.gz |
Merge branch 'nightly-1.29' - #95 Working support for rustc 1.29
Diffstat (limited to 'src/trans/allocator.cpp')
-rw-r--r-- | src/trans/allocator.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/trans/allocator.cpp b/src/trans/allocator.cpp index 5f61093d..9f5559ae 100644 --- a/src/trans/allocator.cpp +++ b/src/trans/allocator.cpp @@ -12,25 +12,14 @@ #define DEF_METHOD(name, ret) { #name, AllocatorDataTy::ret, sizeof(ALLOCATOR_METHODS_ARGS_##name)/sizeof(AllocatorDataTy), ALLOCATOR_METHODS_ARGS_##name } DEF_METHOD_ARGS(alloc, AllocatorDataTy::Layout) -DEF_METHOD_ARGS(oom, AllocatorDataTy::AllocError) DEF_METHOD_ARGS(dealloc, AllocatorDataTy::Ptr, AllocatorDataTy::Layout) -DEF_METHOD_ARGS(usable_size, AllocatorDataTy::LayoutRef) -DEF_METHOD_ARGS(realloc, AllocatorDataTy::Ptr, AllocatorDataTy::Layout, AllocatorDataTy::Layout) +DEF_METHOD_ARGS(realloc, AllocatorDataTy::Ptr, AllocatorDataTy::Layout, AllocatorDataTy::Usize) DEF_METHOD_ARGS(alloc_zeroed, AllocatorDataTy::Layout) -DEF_METHOD_ARGS(alloc_excess, AllocatorDataTy::Layout) -DEF_METHOD_ARGS(realloc_excess, AllocatorDataTy::Ptr, AllocatorDataTy::Layout, AllocatorDataTy::Layout) -DEF_METHOD_ARGS(grow_in_place, AllocatorDataTy::Ptr, AllocatorDataTy::Layout, AllocatorDataTy::Layout) -DEF_METHOD_ARGS(shrink_in_place, AllocatorDataTy::Ptr, AllocatorDataTy::Layout, AllocatorDataTy::Layout) -const AllocatorMethod ALLOCATOR_METHODS[10] = { +const AllocatorMethod ALLOCATOR_METHODS[4] = { DEF_METHOD(alloc, ResultPtr), - DEF_METHOD(oom, Never), DEF_METHOD(dealloc, Unit), - DEF_METHOD(usable_size, UsizePair), DEF_METHOD(realloc, ResultPtr), - DEF_METHOD(alloc_zeroed, ResultPtr), - DEF_METHOD(alloc_excess, ResultExcess), - DEF_METHOD(realloc_excess, ResultExcess), - DEF_METHOD(grow_in_place, ResultUnit), - DEF_METHOD(shrink_in_place, ResultUnit) + DEF_METHOD(alloc_zeroed, ResultPtr) }; +const size_t NUM_ALLOCATOR_METHODS = sizeof(ALLOCATOR_METHODS)/sizeof(ALLOCATOR_METHODS[0]); |