emlabcpp
modern opinionated embedded C++ library
memory_resource.h
Go to the documentation of this file.
1 
24 #pragma once
25 
26 #include <cstddef>
27 
28 namespace emlabcpp::pmr
29 {
31 {
32 public:
33  [[nodiscard]] virtual void* allocate( std::size_t bytes, std::size_t alignment ) = 0;
34  [[nodiscard]] virtual bool
35  deallocate( void* ptr, std::size_t bytes, std::size_t alignment ) = 0;
36  [[nodiscard]] virtual bool is_equal( memory_resource const& other ) const noexcept = 0;
37  [[nodiscard]] virtual bool is_full() const noexcept = 0;
38  virtual ~memory_resource() = default;
39 };
40 } // namespace emlabcpp::pmr
Definition: memory_resource.h:31
virtual void * allocate(std::size_t bytes, std::size_t alignment)=0
virtual bool is_full() const noexcept=0
virtual bool deallocate(void *ptr, std::size_t bytes, std::size_t alignment)=0
virtual bool is_equal(memory_resource const &other) const noexcept=0
MIT License.
Definition: aliases.h:36
constexpr std::array< std::byte, N > bytes(Args const &... args)
Conveft the provided arguments into array of std::byte.
Definition: algorithm.h:524