On 28 September 2017 at 00:07, Benedek Thaler via Boost < boost@lists.boost.org> wrote:
This is to allow further customization points without an additional policy argument. One issue with the approach above: It isn't clear whether 512 is a number of elements or bytes. de::batch_deque
> is conceivable tough.
In a different but related application, I considered the underlying allocator (all Windows here), VirtualAlloc https://msdn.microsoft.com/en-us/library/windows/desktop/aa366887(v=vs.85).a.... Requesting memory from the OS (bar my understanding) results in at least one memory page (4096 Kb) to be allocated (or a multiple of that). Not wanting to let any memory go to waste (it's already allocated anyway), I defined a template parameter that stipulates the *minimum* number of objects to be allocated in one segment. One can then calculate the number of pages required to make up that segment and following that, the number of objects that are actually being reserved in that segment. All this can obviously be static constexpr C++14 member functions. Please comment (anyone), as I might be totally deluded (as I'm still not really sure on this) and don't mind being put straight (preferably). degski -- "*Ihre sogenannte Religion wirkt bloß wie ein Opiat reizend, betäubend, Schmerzen aus Schwäche stillend.*" - Novalis 1798