#pragma once #include #include #include #include #include "../architecture/global.h" #include "Object_Semantics.h" #ifndef RENDERIVE_FRAME_ARENA_GROW #define RENDERIVE_FRAME_ARENA_GROW 1 #endif namespace renderive { struct Thread_Frame_Scratch; class LIB_DECL Frame_Arena : Immovable { public: explicit Frame_Arena(std::size_t initial_buffer_size = 64 * 1024); ~Frame_Arena(); std::pmr::memory_resource* resource() noexcept; private: Thread_Frame_Scratch* scratch{}; std::pmr::memory_resource* previous{}; std::optional arena; }; LIB_DECL std::pmr::memory_resource* frame_memory_resource(); }