Skip to content

Commit 356cfcb

Browse files
committed
GPU: Make vecpod allocator stateless
1 parent dc52267 commit 356cfcb

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

‎GPU/GPUTracking/utils/vecpod.h‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@
2020
template <class T>
2121
struct vecpod_allocator {
2222
typedef T value_type;
23-
vecpod_allocator() noexcept : stdalloc() {}
24-
T* allocate(std::size_t n) { return stdalloc.allocate(n); }
25-
void deallocate(T* p, std::size_t n) { stdalloc.deallocate(p, n); }
23+
vecpod_allocator() noexcept = default;
24+
T* allocate(std::size_t n) { return std::allocator<T>().allocate(n); }
25+
void deallocate(T* p, std::size_t n) { std::allocator<T>().deallocate(p, n); }
2626
static void construct(T*) {}
27-
bool operator==(const vecpod_allocator&) const { return true; } // Stateless, needed e.g. for the move assignment of std::vector
28-
std::allocator<T> stdalloc;
27+
bool operator==(const vecpod_allocator&) const { return true; } // Stateless (no member, so std::vector does not store it), needed e.g. for the move assignment of std::vector
2928
};
3029

3130
template <class T>

0 commit comments

Comments
 (0)