Boost logo

Boost :

Subject: Re: [boost] [fiber] ready for next review
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2015-12-05 10:05:57

2015-12-05 15:03 GMT+01:00 Agustín K-ballo Bergé <kaballo86_at_[hidden]>:

> I found an unusual pattern in the code, where memory is allocated via an
> allocator's `allocate` but afterwards `construct` is side-stepped and
> placement new is used instead. This breaks proper allocator support.
> Curiously `destroy` is correctly used down the line.

allocators: classes fixedsize_stack/segmented_stack etc. are not
allocators you know by the C++standard(s). those classes are used to
allocate stack space.
The classes make use of fucntionallity not common for allocators you
have had in mind - for instance adding a protected page at the end or
using splitstack-functions like __splitstack_makecontext).

> Furthermore, from a cursory look it seems C++11 allocators are not
> supported. The code assumes a C++03 allocator interface. If it is
> intentional then this requirement should be documented.

In class promise and packaged_task probably simply copy&paste the code from
the StackAllocator snippets.
What's wrong with allocator::allocate() + placement new instead of
allocator::allocate() + allocator::construct()?

Boost list run by bdawes at, gregod at, cpdaniel at, john at