19class sdram_allocator {
23 constexpr sdram_allocator()
noexcept =
default;
26 constexpr sdram_allocator(
const sdram_allocator<U>&)
noexcept {};
28 [[nodiscard]] T* allocate(std::size_t n)
noexcept(
false) {
32 void* addr = GeneralMemoryAllocator::get().allocLowSpeed(n *
sizeof(T));
33 if (addr ==
nullptr) [[unlikely]] {
34 throw deluge::exception::BAD_ALLOC;
36 return static_cast<T*
>(addr);
39 void deallocate(T* p, std::size_t n) { GeneralMemoryAllocator::get().dealloc(p); }
42 bool operator==(
const sdram_allocator<U>& o) {
47 bool operator!=(
const sdram_allocator<U>& o) {