Ticket #11823: boost_asio_hash_map_exception_safety.patch

File boost_asio_hash_map_exception_safety.patch, 1.5 KB (added by Sorin Fetche <sorin.fetche@…>, 6 years ago)
  • boost_1_60_0/boost/asio/detail/hash_map.hpp

    Patch to fix exception safety in boost::asio::detail::hash_map.
    Related to https://svn.boost.org/trac/boost/ticket/11823
    
    ----
    
    Steps to recreate the patch:
    1) Original boost sources in the directory: 
           packages\3rdParty\boost\<version>\src\original\boost_<version>\...
    2) Modified sources in:
           packages\3rdParty\boost\<version>\src\patched\boost_<version>\...
    3) Cygwin console, in folder: packages/3rdParty/boost/<version>/src
    4) Patch generated as: 
       diff -Nru original patched > boost_asio_hash_map_exception_safety.patch
    5) This note added to the patch file
    
    
    diff -Nru original/boost_1_60_0/boost/asio/detail/hash_map.hpp patched/boost_1_60_0/boost/asio/detail/hash_map.hpp
    old new  
    244244  {
    245245    if (num_buckets == num_buckets_)
    246246      return;
    247     num_buckets_ = num_buckets;
    248     BOOST_ASIO_ASSERT(num_buckets_ != 0);
     247    BOOST_ASIO_ASSERT(num_buckets != 0);
    249248
    250249    iterator end_iter = values_.end();
    251250
    252251    // Update number of buckets and initialise all buckets to empty.
    253     bucket_type* tmp = new bucket_type[num_buckets_];
     252    bucket_type* tmp = new bucket_type[num_buckets];
    254253    delete[] buckets_;
    255254    buckets_ = tmp;
     255    num_buckets_ = num_buckets;
    256256    for (std::size_t i = 0; i < num_buckets_; ++i)
    257257      buckets_[i].first = buckets_[i].last = end_iter;
    258258