Re: [PATCH] Fix incorrect assertion when deallocating big block

2018-11-14 Thread Jonathan Wakely
On 14/11/18 20:26 +, Jonathan Wakely wrote: On 14/11/18 10:31 +0100, Christophe Lyon wrote: On Tue, 13 Nov 2018 at 23:58, Jonathan Wakely wrote: Since a big_block rounds up the size to a multiple of big_block::min it is wrong to assert that the supplied number of bytes equals the big_bloc

Re: [PATCH] Fix incorrect assertion when deallocating big block

2018-11-14 Thread Jonathan Wakely
On 14/11/18 10:31 +0100, Christophe Lyon wrote: On Tue, 13 Nov 2018 at 23:58, Jonathan Wakely wrote: Since a big_block rounds up the size to a multiple of big_block::min it is wrong to assert that the supplied number of bytes equals the big_block's size(). Add big_block::alloc_size(size_t) to

Re: [PATCH] Fix incorrect assertion when deallocating big block

2018-11-14 Thread Christophe Lyon
On Tue, 13 Nov 2018 at 23:58, Jonathan Wakely wrote: > > Since a big_block rounds up the size to a multiple of big_block::min it > is wrong to assert that the supplied number of bytes equals the > big_block's size(). Add big_block::alloc_size(size_t) to calculate the > allocated size consistently,

Re: [PATCH] Fix incorrect assertion when deallocating big block

2018-11-13 Thread Jonathan Wakely
@@ -932,8 +946,7 @@ namespace pmr } void - __pool_resource::deallocate(void* p, size_t bytes [[maybe_unused]], - size_t alignment [[maybe_unused]]) + __pool_resource::deallocate(void* p, size_t bytes, size_t alignment) { const auto it = std::lower_bou

[PATCH] Fix incorrect assertion when deallocating big block

2018-11-13 Thread Jonathan Wakely
Since a big_block rounds up the size to a multiple of big_block::min it is wrong to assert that the supplied number of bytes equals the big_block's size(). Add big_block::alloc_size(size_t) to calculate the allocated size consistently, and add comments to the code. * src/c++17/memory_reso