Use allocate in ArenaStlAllocator

This commit is contained in:
2025-08-15 13:38:13 -04:00
parent 8e33b477eb
commit 9e7e3ed40a
2 changed files with 3 additions and 5 deletions

View File

@@ -5,7 +5,6 @@
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <new>
#include <type_traits>
@@ -595,13 +594,11 @@ public:
T *allocate(size_type n) {
if (n == 0)
return nullptr;
return static_cast<T *>(arena_->allocate_raw(n * sizeof(T), alignof(T)));
return arena_->allocate<T>(n);
}
void deallocate(T *ptr, size_type n) noexcept {
void deallocate(T *, size_type) noexcept {
// Arena allocator doesn't support individual deallocation
(void)ptr;
(void)n;
}
template <typename U>