//! Custom allocation framekwork for frozen (RO) and/or secure allocations, shared allocations, aliased allocation, etc. (polymorphic.) #ifndef _ALLOC_H #define _ALLOC_H #ifdef __cplusplus #include #endif #include "types.h" #include "macros.h" LINK_START(C) typedef struct base_allocator alloc_t; //TODO: C API anonlogue for allocator interface below. LINK_END #if $CXX extern "C" { struct base_allocator { //TODO: Allocator interface... virtual ~base_allocator(); } } namespace alloc { class FrozenAllocator : public alloc_t { struct _impl; protected: struct anon_raw_secmem; /*struct anon_raw_secmem::deleter { operator };*/ struct alloc_info; struct alloc_value; public: template FrozenAllocator(FrozenAllocator &&) noexcept; FrozenAllocator& operator=(FrozenAllocator &&); FrozenAllocator(const FrozenAllocator&) = delete; FrozenAllocator& operator=(const FrozenAllocator&) = delete; virtual ~FrozenAllocator(); private: std::unique_ptr<_impl> inner_; //std::shared_ptr m_manager; //std::map> m_values; }; } #endif #endif /* _ALLOC_H */