home | help
std::experi...ol_resource(3)   C++ Standard Libary  std::experi...ol_resource(3)

NAME
     std::experimental::pmr::synchronized_pool_resource     -	 std::experimen-
     tal::pmr::synchronized_pool_resource

Synopsis
	Defined in header <experimental/memory_resource>
	class synchronized_pool_resource : public		   (library fun-
     damentals TS)
	memory_resource;

	The class std::experimental::pmr::synchronized_pool_resource is  a  gen-
     eral-purpose
	memory resource class with the following properties:

	  *  It  owns  the allocated memory and frees it on destruction, even if
     deallocate has
	    not been called for some of the allocated blocks.
	  * It consists of a collection of pools that serves request for differ-
     ent block
	    sizes. Each pool manages a collection of chunks that  are  then  di-
     vided into
	    blocks of uniform size.
	  * Calls to do_allocate are dispatched to the pool serving the smallest
     blocks
	    accommodating the requested size.
	  * Exhausting memory in the pool causes the next allocation request for
     that pool
	    to	allocate an additional chunk of memory from the upstream alloca-
     tor to
	    replenish the pool. The chunk size obtained increases geometrically.
	  * Allocations requests that exceed the largest block size  are  served
     from the
	    upstream allocator directly.
	  *  The largest block size and maximum chunk size may be tuned by pass-
     ing a
	    std::experimental::pmr::pool_options struct to its constructor.

	synchronized_pool_resource may be accessed from multiple threads without
     external
	synchronization, and may have thread-specific pools to	reduce	synchro-
     nization costs.
	If the memory resource is only accessed from one thread,
	unsynchronized_pool_resource is more efficient.

Member functions
	constructor	  constructs a synchronized_pool_resource
			  (public member function)
	destructor	   destroys  a synchronized_pool_resource, releasing all
     allocated
	[virtual]	  memory
			  (virtual public member function)
	operator=	   copy  assignment  operator	is   deleted.	synchro-
     nized_pool_resource is
	[deleted]	  not copy assignable
			  (public member function)

Public member functions
	release 	  release all allocated memory
			  (public member function)
	upstream_resource returns a pointer to the upstream memory resource
			  (public member function)
			  returns  the options that control the pooling behavior
     of this
	options 	  resource
			  (public member function)

Protected member functions
	do_allocate	  allocate memory
	[virtual]	  (virtual protected member function)
	do_deallocate	  return memory to the pool
	[virtual]	  (virtual protected member function)
	do_is_equal	  compare for equality with another memory_resource
	[virtual]	  (virtual protected member function)

Category:
	  * Noindexed pages

http://cppreference.com 	   2024.06.10	    std::experi...ol_resource(3)

home | help