Boost logo

Boost :

Subject: Re: [boost] [container] Implemented Polymorphic Memory Resources
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2015-09-08 12:57:03


Le 07/09/15 22:23, Ion Gaztañaga a écrit :
> Hi to all,
>
> In case anyone is interested, I just committed to the develop branch
> the implementation of the proposal "N3916 Polymorphic Memory Resources
> - r2" that was included in the TS "C++ Extensions for Library
> Fundamentals". The library continues to support C++03 compilers.
>
> It basically introduces in namespace boost::container::pmr and the
> path boost/container/pmr/:
>
> - memory_resource
> - synchronized_pool_resource
> - unsynchronized_pool_resource
> - monotonic_buffer_resource
> - polymorphic_allocator
> - resource_adaptor
> - new_delete_resource / null_memory_resource / get_default_resource /
> set_default_resource
> - Aliases for all containers, using the polymorphic_allocator.
>
> As default resource, new_delete_resource and null_memory_resource are
> required to be globals, they are implemented in the separately
> compiled boost.container library that was used to implement the
> DLMalloc-based extended allocator.
>
> It seems that many users dislike building Boost libraries, but I felt
> this was the correct way to implement it. We could change or make it
> optionally header-only if there is demand. To avoid dependencies to
> some users, I made sure that memory_resource and resource_adaptor,
> which don't depend on the global default memory resource, can be used
> without linking the library.
>
> Some logic was refactored from scoped_allocator_adaptor to avoid
> repeating the complicated template and preprocessor machinery in the
> polymorphic_allocator. I hope this does not cause any problem to
> scoped allocator users.
>
> Any suggestion or bug report is welcome. Best,
>
>
Thanks Ion,

I will try to integrate it on boost::promise/packaged_task.

Best,
Vicente


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk