From c5e90ed6c7878178d92aef372d67ed12d126bfc0 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 19 May 2020 12:15:57 -0700 Subject: Use an enum for FamCount --- common/almalloc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/almalloc.h b/common/almalloc.h index 599d21c4..5afab7e1 100644 --- a/common/almalloc.h +++ b/common/almalloc.h @@ -43,15 +43,15 @@ void al_free(void *ptr) noexcept; void operator delete[](void *block, void*) noexcept { al_free(block); } \ void operator delete[](void *block) noexcept { al_free(block); } -struct FamCount { size_t mCount; }; +enum FamCount : size_t { }; #define DEF_FAM_NEWDEL(T, FamMem) \ static constexpr size_t Sizeof(size_t count) noexcept \ { return decltype(FamMem)::Sizeof(count, offsetof(T, FamMem)); } \ \ - void *operator new(size_t /*size*/, FamCount fam) \ + void *operator new(size_t /*size*/, FamCount count) \ { \ - if(void *ret{al_malloc(alignof(T), T::Sizeof(fam.mCount))}) \ + if(void *ret{al_malloc(alignof(T), T::Sizeof(count))}) \ return ret; \ throw std::bad_alloc(); \ } \ -- cgit v1.2.3