Compare commits

...

3 Commits

Author SHA1 Message Date
Peter Dimov
060d4aea6b Change sprintf to snprintf in benchmarks. Fixes #41. 2025-08-21 19:31:51 +03:00
Peter Dimov
186c38e255 Add benchmark/Jamfile 2025-08-21 19:26:00 +03:00
Peter Dimov
c8dab7f85a Remove windows-2019 from GHA 2025-08-21 18:22:07 +03:00
4 changed files with 22 additions and 12 deletions

View File

@@ -277,14 +277,6 @@ jobs:
fail-fast: false
matrix:
include:
- toolset: msvc-14.0
cxxstd: 14,latest
addrmd: 32,64
os: windows-2019
- toolset: msvc-14.2
cxxstd: "14,17,20,latest"
addrmd: 32,64
os: windows-2019
- toolset: msvc-14.3
cxxstd: "14,17,20,latest"
addrmd: 32,64

18
benchmark/Jamfile Normal file
View File

@@ -0,0 +1,18 @@
# Copyright Daniel James 2005. Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
import testing ;
project :
requirements
<library>/boost/container_hash//boost_container_hash
<library>/boost/core//boost_core
<library>/boost/unordered//boost_unordered
;
link char_seq.cpp ;
link unordered.cpp ;
link unordered_flat.cpp : <cxxstd>11:<build>no <cxxstd>14:<build>no ;
link word_count.cpp : <cxxstd>11:<build>no <cxxstd>14:<build>no ;

View File

@@ -79,11 +79,11 @@ int main()
if( k & 1 )
{
sprintf( buffer, "prefix_%llu_suffix", k );
std::snprintf( buffer, sizeof( buffer ), "prefix_%llu_suffix", k );
}
else
{
sprintf( buffer, "{%u}", static_cast<unsigned>( k ) );
std::snprintf( buffer, sizeof( buffer ), "{%u}", static_cast<unsigned>( k ) );
}
v.push_back( buffer );

View File

@@ -356,11 +356,11 @@ int main()
if( k & 1 )
{
sprintf( buffer, "prefix_%llu_suffix", k );
std::snprintf( buffer, sizeof( buffer ), "prefix_%llu_suffix", k );
}
else
{
sprintf( buffer, "{%u}", static_cast<unsigned>( k ) );
std::snprintf( buffer, sizeof( buffer ), "{%u}", static_cast<unsigned>( k ) );
}
v.push_back( buffer );