blob: 32ba005fca26ca20529c8acf5ec9823f81ecf56a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#pragma once
#include <euler/heap.hpp>
namespace std {
template <class T>
struct allocator {
using value_type = T;
constexpr allocator() noexcept {}
constexpr allocator(const allocator &other) noexcept {}
template <class U>
constexpr allocator(const allocator<U> &other) noexcept {}
constexpr ~allocator() {}
constexpr T *allocate(size_t n) {
return (T *)euler::heap::get_block(n * sizeof(T));
}
constexpr void deallocate(T *p, size_t n) {
euler::heap::return_block(p, n * sizeof(T));
}
};
}
|