Use allocate in ArenaStlAllocator
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "arena_allocator.hpp"
|
||||
#include <cassert>
|
||||
#include <iomanip>
|
||||
|
||||
ArenaAllocator::~ArenaAllocator() {
|
||||
while (current_block_) {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user