4#ifndef TETL_MEMORY_MONOTONIC_ALLOCATOR_HPP
5#define TETL_MEMORY_MONOTONIC_ALLOCATOR_HPP
7#include <etl/_cstddef/byte.hpp>
8#include <etl/_cstddef/ptrdiff_t.hpp>
9#include <etl/_cstddef/size_t.hpp>
10#include <etl/_memory/align.hpp>
11#include <etl/_span/span.hpp>
17 using size_type =
etl::size_t;
18 using difference_type =
etl::ptrdiff_t;
28 auto* result =
reinterpret_cast<T*>(_ptr);
29 _ptr =
reinterpret_cast<
char*>(_ptr) +
sizeof(T) * n;
38 etl::ignore_unused(p, n);
Definition adjacent_find.hpp:9
auto align(etl::size_t alignment, etl::size_t size, void *&ptr, etl::size_t &space) noexcept -> void *
Given a pointer ptr to a buffer of size space, returns a pointer aligned by the specified alignment f...
Definition align.hpp:23
enum TETL_MAY_ALIAS byte
etl::byte is a distinct type that implements the concept of byte as specified in the C++ language def...
Definition byte.hpp:22
Definition monotonic_allocator.hpp:15
auto deallocate(T *p, etl::size_t n) -> void
Definition monotonic_allocator.hpp:36
monotonic_allocator(etl::span< etl::byte > memory)
Definition monotonic_allocator.hpp:20
auto allocate(etl::size_t n) -> T *
Definition monotonic_allocator.hpp:25
constexpr auto data() const noexcept -> pointer
Returns a pointer to the beginning of the sequence.
Definition span.hpp:225
constexpr auto size() const noexcept -> size_type
Returns the number of elements in the span.
Definition span.hpp:231