diff options
author | Chris Robinson <[email protected]> | 2020-05-19 12:15:57 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-05-19 12:15:57 -0700 |
commit | c5e90ed6c7878178d92aef372d67ed12d126bfc0 (patch) | |
tree | d4761b076ce4b14ed0094dea641fdb75dc7b7e0f /common | |
parent | 825206bfa2b59ae124cc8fb34c5b668f8a682224 (diff) |
Use an enum for FamCount
Diffstat (limited to 'common')
-rw-r--r-- | common/almalloc.h | 6 |
1 files changed, 3 insertions, 3 deletions
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(); \ } \ |