r266087 - in /trunk/libstdc++-v3: ChangeLog src...
redi@gcc.gnu.org
redi@gcc.gnu.org
Tue Nov 13 22:57:00 GMT 2018
Author: redi
Date: Tue Nov 13 22:57:44 2018
New Revision: 266087
URL: https://gcc.gnu.org/viewcvs?rev=266087&root=gcc&view=rev
Log:
Fix overflows in std::pmr::unsynchonized_pool_resource
* src/c++17/memory_resource.cc (bitset::full()): Handle edge case
for _M_next_word maximum value.
(bitset::get_first_unset(), bitset::set(size_type)): Use
update_next_word() to update _M_next_word.
(bitset::update_next_word()): New function, avoiding wraparound of
unsigned _M_next_word member.
(bitset::max_word_index()): New function.
(chunk::chunk(void*, uint32_t, void*, size_t)): Add assertion.
(chunk::max_bytes_per_chunk()): New function.
(pool::replenish(memory_resource*, const pool_options&)): Prevent
_M_blocks_per_chunk from exceeding max_blocks_per_chunk or from
causing chunk::max_bytes_per_chunk() to be exceeded.
* testsuite/20_util/unsynchronized_pool_resource/allocate-max-chunks.cc:
New test.
Added:
trunk/libstdc++-v3/testsuite/20_util/unsynchronized_pool_resource/allocate-max-chunks.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/src/c++17/memory_resource.cc
More information about the Libstdc++-cvs
mailing list