/* * Copyright 2023 jacqueline * * SPDX-License-Identifier: GPL-3.0-only */ #include "memory_resource.hpp" #include #include #include #include #include namespace memory { Resource kSpiRamResource{Capabilities::kSpiRam}; void* Resource::do_allocate(std::size_t bytes, std::size_t alignment) { return heap_caps_malloc(bytes, std::to_underlying(caps_)); } void Resource::do_deallocate(void* p, std::size_t bytes, std::size_t alignment) { heap_caps_free(p); } bool Resource::do_is_equal( const std::pmr::memory_resource& other) const noexcept { return this == &other; } } // namespace memory