template<
std::size_t array_size>
class cetl::pf17::pmr::unsynchronized_array_memory_resource< array_size >
Implementation of cetl::pf17::pmr::memory_resource that uses cetl::pmr::unsynchronized_buffer_memory_resource_delegate as the internal implementation backed by an std::array data member using array_size * sizeof(cetl::pf17::byte)s of memory.
- Note
- This object cannot be moved since there may be outstanding pointers to the internal memory store. If you need a movable memory resource with similar semantics see cetl::pf17::pmr::unsynchronized_buffer_memory_resource.
- Example Usage
void* r = nullptr;
#if defined(__cpp_exceptions)
try
{
#endif
r = resource.allocate(64, 128);
#if defined(__cpp_exceptions)
{
}
#endif
By over-provisioning the buffer the same alignment will succeed:
resource.deallocate(r, 64, 128);
(See full example here...)