diff options
author | Chris Robinson <[email protected]> | 2019-06-03 22:58:56 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-06-03 22:58:56 -0700 |
commit | f0bc9d8a9b45a86cf0736a3f118b28ae6fdb90f0 (patch) | |
tree | 268a2f8e04f8b95b3141c2155d97694c0a45f948 /common/almalloc.h | |
parent | c76fb714ccd44584f18c1be7c8366c462c493831 (diff) |
Improve alignment handling for the alignment allocator
Diffstat (limited to 'common/almalloc.h')
-rw-r--r-- | common/almalloc.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/almalloc.h b/common/almalloc.h index 406c2d31..0d77c46d 100644 --- a/common/almalloc.h +++ b/common/almalloc.h @@ -39,7 +39,7 @@ int al_is_sane_alignment_allocator(void) noexcept; namespace al { -template<typename T, size_t alignment=DEF_ALIGN> +template<typename T, size_t alignment=alignof(T)> struct allocator : public std::allocator<T> { using size_type = size_t; using pointer = T*; @@ -97,7 +97,7 @@ std::unique_ptr<T> make_unique(ArgsT&&...args) * struct, with placement new, to have a run-time-sized array that's embedded * with its size. */ -template<typename T,size_t alignment=DEF_ALIGN> +template<typename T, size_t alignment=alignof(T)> struct FlexArray { const size_t mSize; alignas(alignment) T mArray[]; |