aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2018-11-13 22:57:48 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2018-11-13 22:57:48 +0000
commitd3306a84a6cc954ff9d28d8a915a891fe15270f5 (patch)
tree5c1a34d3f20bf1fa6257f6e8a0b1c51e3dc04f6f /gcc
parent6bdd58f73a33cceba4da5966c17c356ecc22b0c6 (diff)
downloadgcc-d3306a84a6cc954ff9d28d8a915a891fe15270f5.zip
gcc-d3306a84a6cc954ff9d28d8a915a891fe15270f5.tar.gz
gcc-d3306a84a6cc954ff9d28d8a915a891fe15270f5.tar.bz2
Fix incorrect assertion when deallocating big block
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_resource.cc (big_block): Improve comments. (big_block::all_ones): Remove. (big_block::big_block(size_t, size_t)): Use alloc_size. (big_block::size()): Add comment, replace all_ones with equivalent expression. (big_block::align()): Shift value of correct type. (big_block::alloc_size(size_t)): New function to round up size. (__pool_resource::allocate(size_t, size_t)): Add comment. (__pool_resource::deallocate(void*, size_t, size_t)): Likewise. Fix incorrect assertion by using big_block::alloc_size(size_t). * testsuite/20_util/unsynchronized_pool_resource/allocate.cc: Add more tests for unpooled allocations. From-SVN: r266088
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions