ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
Pmr.h File Reference

The pools of ADS as memory resources of the standard library, beyond the book: PmrResource< R > is a std::pmr::memory_resource on a resource \( R \) of ADS with allocate( b , a ) and deallocate( p , b , a ) (PoolResource of PoolAllocator.h by default), so that every container of std::pmr, and those of Boost.Container on std::pmr, take the size classes of ADS for their nodes. More...

#include "ADS/memory/PoolAllocator.h"
#include <cstddef>
#include <memory_resource>

Go to the source code of this file.

Classes

class  ADS::PmrResource< R >
 the resource \( r \) of ADS as a std::pmr::memory_resource More...

Namespaces

namespace  ADS

Detailed description

The pools of ADS as memory resources of the standard library, beyond the book: PmrResource< R > is a std::pmr::memory_resource on a resource \( R \) of ADS with allocate( b , a ) and deallocate( p , b , a ) (PoolResource of PoolAllocator.h by default), so that every container of std::pmr, and those of Boost.Container on std::pmr, take the size classes of ADS for their nodes.

Each allocation is one virtual call, the price of std::pmr, which the class known at compile time of PoolAllocator avoids; the adapter is for the programs already written on std::pmr. Two adapters are equal when they are on the same resource.

See also
P. Halpern, Polymorphic memory resources, ISO/IEC JTC1 SC22 WG21 N3916, 2014, https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3916.pdf
Author
Donato Meoli
Dipartimento di Informatica
Università di Pisa