Skip to content

Commit

Permalink
Revert "Fix MSVC compilation of c0035af"
Browse files Browse the repository at this point in the history
This reverts commit 3d2824b.
  • Loading branch information
lhog committed Feb 21, 2024
1 parent 3d2824b commit f9a09a5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions rts/System/MemPoolTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ template<uint32_t NumBuckets, size_t BucketSize> struct PassThroughPool {
// Helper to infer the memory alignment and size from a set of types.
template <class ...T>
struct TypesMem {
static constexpr auto S = std::max({ sizeof(T)... });
static constexpr auto A = std::max({ alignof(T)... });
alignas(std::max({alignof(T)...})) uint8_t data[std::max({sizeof(T)...})];
};

template<size_t S, size_t Alignment> struct DynMemPool {
Expand Down Expand Up @@ -161,7 +160,7 @@ template<size_t S, size_t Alignment> struct DynMemPool {

// Helper to infer the DynMemPool pool parameters from a types.
template<class ...T>
using DynMemPoolT = DynMemPool<TypesMem<T...>::S, TypesMem<T...>::A>;
using DynMemPoolT = DynMemPool<sizeof(TypesMem<T...>), alignof(TypesMem<T...>)>;

// fixed-size dynamic version
// page size per chunk, number of chunks, number of pages per chunk
Expand Down Expand Up @@ -280,7 +279,7 @@ template<size_t S, size_t N, size_t K, size_t Alignment> struct FixedDynMemPool

// Helper to infer the FixedDynMemPool pool parameters from a types.
template<size_t N, size_t K, class ...T>
using FixedDynMemPoolT = FixedDynMemPool<TypesMem<T...>::S, N, K, TypesMem<T...>::A>;
using FixedDynMemPoolT = FixedDynMemPool<sizeof(TypesMem<T...>), N, K, alignof(TypesMem<T...>)>;

// fixed-size version.
template<size_t N, size_t S, size_t Alignment> struct StaticMemPool {
Expand Down Expand Up @@ -366,7 +365,7 @@ template<size_t N, size_t S, size_t Alignment> struct StaticMemPool {

// Helper to infer the StaticMemPool pool parameters from a types.
template<size_t N, class ...T>
using StaticMemPoolT = StaticMemPool<N, TypesMem<T...>::S, TypesMem<T...>::A>;
using StaticMemPoolT = StaticMemPool<N, sizeof(TypesMem<T...>), alignof(TypesMem<T...>)>;


// dynamic memory allocator operating with stable index positions
Expand Down

0 comments on commit f9a09a5

Please sign in to comment.