aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-05-19 12:15:57 -0700
committerChris Robinson <[email protected]>2020-05-19 12:15:57 -0700
commitc5e90ed6c7878178d92aef372d67ed12d126bfc0 (patch)
treed4761b076ce4b14ed0094dea641fdb75dc7b7e0f /common
parent825206bfa2b59ae124cc8fb34c5b668f8a682224 (diff)
Use an enum for FamCount
Diffstat (limited to 'common')
-rw-r--r--common/almalloc.h6
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(); \
} \