Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5339bf67d9 | |||
| bd24dfd284 | |||
| faf54eef0d | |||
| 97b52879f5 | |||
| 9a7d1d336a | |||
| 3fc18d56ac | |||
| 6bcf457b46 | |||
| 01b2369700 | |||
| fcb3f0e82a | |||
| 1e4deb10a1 | |||
| 6ee93f17e4 | |||
| 7e41e08a57 | |||
| 7a6c8eca09 | |||
| dce386068b |
@@ -31,14 +31,28 @@ environment:
|
||||
B2_VARIANT: debug,release
|
||||
|
||||
matrix:
|
||||
- FLAVOR: Visual Studio 2008, 2010, 2012
|
||||
- FLAVOR: Visual Studio 2008
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
B2_TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0
|
||||
B2_TOOLSET: msvc-9.0
|
||||
B2_ADDRESS_MODEL: 32 # No 64bit support
|
||||
|
||||
- FLAVOR: Visual Studio 2013, 2015
|
||||
- FLAVOR: Visual Studio 2010
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
B2_TOOLSET: msvc-12.0,msvc-14.0
|
||||
B2_TOOLSET: msvc-10.0
|
||||
B2_ADDRESS_MODEL: 32 # No 64bit support
|
||||
|
||||
- FLAVOR: Visual Studio 2012
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
B2_TOOLSET: msvc-11.0
|
||||
B2_ADDRESS_MODEL: 32 # No 64bit support
|
||||
|
||||
- FLAVOR: Visual Studio 2013
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
B2_TOOLSET: msvc-12.0
|
||||
|
||||
- FLAVOR: Visual Studio 2015
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
B2_TOOLSET: msvc-14.0
|
||||
|
||||
- FLAVOR: Visual Studio 2017, C++14
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
@@ -55,32 +69,32 @@ environment:
|
||||
B2_CXXSTD: latest
|
||||
B2_TOOLSET: msvc-14.1
|
||||
|
||||
- FLAVOR: cygwin (32-bit, C++03,11)
|
||||
- FLAVOR: cygwin (32-bit, C++03)
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
ADDPATH: C:\cygwin\bin;
|
||||
B2_ADDRESS_MODEL: 32
|
||||
B2_CXXSTD: 03,11
|
||||
B2_CXXSTD: 03
|
||||
B2_TOOLSET: gcc
|
||||
|
||||
- FLAVOR: cygwin (32-bit, C++14,1z)
|
||||
- FLAVOR: cygwin (32-bit, C++11)
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
ADDPATH: C:\cygwin\bin;
|
||||
B2_ADDRESS_MODEL: 32
|
||||
B2_CXXSTD: 14,1z
|
||||
B2_CXXSTD: 11
|
||||
B2_TOOLSET: gcc
|
||||
|
||||
- FLAVOR: cygwin (64-bit, C++03,11)
|
||||
- FLAVOR: cygwin (32-bit, C++14)
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
ADDPATH: C:\cygwin64\bin;
|
||||
B2_ADDRESS_MODEL: 64
|
||||
B2_CXXSTD: 03,11
|
||||
ADDPATH: C:\cygwin\bin;
|
||||
B2_ADDRESS_MODEL: 32
|
||||
B2_CXXSTD: 14
|
||||
B2_TOOLSET: gcc
|
||||
|
||||
- FLAVOR: cygwin (64-bit, C++14,1z)
|
||||
- FLAVOR: cygwin (32-bit, C++1z)
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
ADDPATH: C:\cygwin64\bin;
|
||||
B2_ADDRESS_MODEL: 64
|
||||
B2_CXXSTD: 14,1z
|
||||
ADDPATH: C:\cygwin\bin;
|
||||
B2_ADDRESS_MODEL: 32
|
||||
B2_CXXSTD: 1z
|
||||
B2_TOOLSET: gcc
|
||||
|
||||
- FLAVOR: cygwin (64-bit, latest, C++03)
|
||||
|
||||
@@ -32,6 +32,16 @@ env:
|
||||
CODECOV_NAME: Github Actions
|
||||
|
||||
jobs:
|
||||
runner-selection:
|
||||
# runs-on: ubuntu-latest
|
||||
runs-on: ${{ github.repository_owner == 'boostorg' && fromJSON('[ "self-hosted", "linux", "x64", "ubuntu-latest-aws" ]') || 'ubuntu-latest' }}
|
||||
outputs:
|
||||
labelmatrix: ${{ steps.aws_hosted_runners.outputs.labelmatrix }}
|
||||
steps:
|
||||
- name: AWS Hosted Runners
|
||||
id: aws_hosted_runners
|
||||
uses: cppalliance/aws-hosted-runners@v1.0.0
|
||||
|
||||
posix:
|
||||
defaults:
|
||||
run:
|
||||
@@ -42,50 +52,55 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
# Linux, gcc
|
||||
- { compiler: gcc-7, cxxstd: '03,11,14,17', os: ubuntu-20.04, install: 'g++-7' }
|
||||
- { compiler: gcc-8, cxxstd: '03,11,14,17', os: ubuntu-20.04, install: 'g++-8' }
|
||||
- { compiler: gcc-9, cxxstd: '03,11,14,17', os: ubuntu-20.04, install: 'g++-9' }
|
||||
- { compiler: gcc-10, cxxstd: '03,11,14,17,20', os: ubuntu-22.04, install: 'g++-10' }
|
||||
- { compiler: gcc-11, cxxstd: '03,11,14,17,20', os: ubuntu-22.04, install: 'g++-11' }
|
||||
- { compiler: gcc-7, cxxstd: '03,11,14,17', os: 'ubuntu-20.04', install: 'g++-7' }
|
||||
- { compiler: gcc-8, cxxstd: '03,11,14,17', os: 'ubuntu-20.04', install: 'g++-8' }
|
||||
- { compiler: gcc-9, cxxstd: '03,11,14,17', os: 'ubuntu-22.04', install: 'g++-9' }
|
||||
- { compiler: gcc-10, cxxstd: '03,11,14,17,20', os: 'ubuntu-22.04', install: 'g++-10' }
|
||||
- { compiler: gcc-11, cxxstd: '03,11,14,17,20', os: 'ubuntu-22.04', install: 'g++-11' }
|
||||
- { name: "gcc-12 w/ sanitizers (03,11,14)", sanitize: yes,
|
||||
compiler: gcc-12, cxxstd: '03,11,14', os: ubuntu-22.04, ccache_key: "san1" }
|
||||
compiler: gcc-12, cxxstd: '03,11,14', os: 'ubuntu-22.04', ccache_key: "san1" }
|
||||
- { name: "gcc-12 w/ sanitizers (17,20,2b)", sanitize: yes,
|
||||
compiler: gcc-12, cxxstd: '17,20,2b', os: ubuntu-22.04, ccache_key: "san2" }
|
||||
compiler: gcc-12, cxxstd: '17,20,2b', os: 'ubuntu-22.04', ccache_key: "san2" }
|
||||
- { name: Collect coverage, coverage: yes,
|
||||
compiler: gcc-12, cxxstd: '03,20', os: ubuntu-22.04, install: 'g++-12-multilib', address-model: '32,64', ccache_key: "cov" }
|
||||
compiler: gcc-12, cxxstd: '03,20', os: 'ubuntu-22.04', install: 'g++-12-multilib', address-model: '32,64', ccache_key: "cov" }
|
||||
|
||||
- { name: "cfoa tsan (gcc)", cxxstd: '11,14,17,20,2b', os: ubuntu-22.04, compiler: gcc-12,
|
||||
targets: 'libs/unordered/test//cfoa_tests', thread-sanitize: yes }
|
||||
- { name: "cfoa tsan (gcc-12)", cxxstd: '11,14,17,20,2b', os: 'ubuntu-22.04', compiler: gcc-12,
|
||||
targets: 'libs/unordered/test//cfoa_tests', thread-sanitize: yes, ccache_key: "tsan" }
|
||||
|
||||
# Linux, clang, libc++
|
||||
- { compiler: clang-7, cxxstd: '03,11,14,17', os: ubuntu-20.04, stdlib: libc++, install: 'clang-7 libc++-7-dev libc++abi-7-dev' }
|
||||
- { compiler: clang-10, cxxstd: '03,11,14,17,20', os: ubuntu-20.04, stdlib: libc++, install: 'clang-10 libc++-10-dev libc++abi-10-dev' }
|
||||
- { compiler: clang-11, cxxstd: '03,11,14,17,20', os: ubuntu-22.04, stdlib: libc++, install: 'clang-11 libc++-11-dev libc++abi-11-dev' }
|
||||
# clang-12 doesn't work on ubuntu-22.04, the linker can't find -lunwind for some reason
|
||||
- { compiler: clang-7, cxxstd: '03,11,14,17', os: 'ubuntu-20.04', stdlib: libc++, install: 'clang-7 libc++-7-dev libc++abi-7-dev' }
|
||||
- { compiler: clang-10, cxxstd: '03,11,14,17,20', os: 'ubuntu-20.04', stdlib: libc++, install: 'clang-10 libc++-10-dev libc++abi-10-dev' }
|
||||
- { compiler: clang-11, cxxstd: '03,11,14,17,20', os: 'ubuntu-22.04', stdlib: libc++, install: 'clang-11 libc++-11-dev libc++abi-11-dev' }
|
||||
# clang-12 doesn't work on 'ubuntu-22.04', the linker can't find -lunwind for some reason
|
||||
- { name: "clang-12 w/ sanitizers (03,11,14)", sanitize: yes,
|
||||
compiler: clang-12, cxxstd: '03,11,14', os: ubuntu-20.04, stdlib: libc++, install: 'clang-12 libc++-12-dev libc++abi-12-dev', ccache_key: "san1" }
|
||||
compiler: clang-12, cxxstd: '03,11,14', os: 'ubuntu-20.04', stdlib: libc++, install: 'clang-12 libc++-12-dev libc++abi-12-dev', ccache_key: "san1" }
|
||||
- { name: "clang-12 w/ sanitizers (17,20,2b)", sanitize: yes,
|
||||
compiler: clang-12, cxxstd: '17,20,2b', os: ubuntu-20.04, stdlib: libc++, install: 'clang-12 libc++-12-dev libc++abi-12-dev', ccache_key: "san2" }
|
||||
- { compiler: clang-13, cxxstd: '03,11,14,17,20,2b', os: ubuntu-22.04, stdlib: libc++, install: 'clang-13 libc++-13-dev libc++abi-13-dev' }
|
||||
- { compiler: clang-14, cxxstd: '03,11,14,17,20,2b', os: ubuntu-22.04, stdlib: libc++, install: 'clang-14 libc++-14-dev libc++abi-14-dev' }
|
||||
compiler: clang-12, cxxstd: '17,20,2b', os: 'ubuntu-20.04', stdlib: libc++, install: 'clang-12 libc++-12-dev libc++abi-12-dev', ccache_key: "san2" }
|
||||
- { compiler: clang-13, cxxstd: '03,11,14,17,20,2b', os: 'ubuntu-22.04', stdlib: libc++, install: 'clang-13 libc++-13-dev libc++abi-13-dev' }
|
||||
|
||||
# not using libc++ because of https://github.com/llvm/llvm-project/issues/52771
|
||||
- { name: "clang-14 w/ sanitizers (03,11,14)", sanitize: yes,
|
||||
compiler: clang-14, cxxstd: '03,11,14', os: ubuntu-22.04, ccache_key: "san1" }
|
||||
compiler: clang-14, cxxstd: '03,11,14', os: 'ubuntu-22.04', ccache_key: "san1" }
|
||||
- { name: "clang-14 w/ sanitizers (17,20,2b)", sanitize: yes,
|
||||
compiler: clang-14, cxxstd: '17,20,2b', os: ubuntu-22.04, ccache_key: "san2" }
|
||||
compiler: clang-14, cxxstd: '17,20,2b', os: 'ubuntu-22.04', ccache_key: "san2" }
|
||||
|
||||
- { name: "cfoa tsan (clang)", cxxstd: '11,14,17,20,2b', os: ubuntu-22.04, compiler: clang-14,
|
||||
- { name: "cfoa tsan (clang-14)", cxxstd: '11,14,17,20,2b', os: 'ubuntu-22.04', compiler: clang-14,
|
||||
targets: 'libs/unordered/test//cfoa_tests', thread-sanitize: yes,
|
||||
stdlib: libc++, install: 'clang-14 libc++-14-dev libc++abi-14-dev' }
|
||||
stdlib: libc++, install: 'clang-14 libc++-14-dev libc++abi-14-dev', ccache_key: "tsan" }
|
||||
|
||||
- { compiler: clang-15, cxxstd: '03,11,14,17,20,2b', os: 'ubuntu-22.04', stdlib: libc++, install: 'clang-15 libc++-15-dev libc++abi-15-dev' }
|
||||
|
||||
# OSX, clang
|
||||
- { compiler: clang, cxxstd: '03,11,14,17,2a', os: macos-11, }
|
||||
- { compiler: clang, cxxstd: '03,11,14,17,2a', os: macos-12, sanitize: yes }
|
||||
- { compiler: clang, cxxstd: '11,14,17,2a', os: macos-12, thread-sanitize: yes, targets: 'libs/unordered/test//cfoa_tests' }
|
||||
- { compiler: clang, cxxstd: '03,11,14,17,2a', os: 'macos-11' }
|
||||
- { compiler: clang, cxxstd: '03,11,14,17,2a', os: 'macos-12', sanitize: yes, ccache_key: "san1" }
|
||||
- { compiler: clang, cxxstd: '11,14,17,2a', os: 'macos-12', thread-sanitize: yes, targets: 'libs/unordered/test//cfoa_tests', ccache_key: "tsan" }
|
||||
- { compiler: clang, cxxstd: '03,11,14,17,20,2b', os: 'macos-13' }
|
||||
|
||||
timeout-minutes: 180
|
||||
runs-on: ${{matrix.os}}
|
||||
timeout-minutes: 360
|
||||
# posix (gcc-12 w/ sanitizers is taking longer than 210 minutes
|
||||
# timeout-minutes: 210
|
||||
needs: [runner-selection]
|
||||
runs-on: ${{ fromJSON(needs.runner-selection.outputs.labelmatrix)[matrix.os] }}
|
||||
container: ${{matrix.container}}
|
||||
env: {B2_USE_CCACHE: 1}
|
||||
|
||||
@@ -229,15 +244,16 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { toolset: msvc-14.0, cxxstd: '14,latest', addrmd: '32,64', os: windows-2019, variant: 'debug,release' }
|
||||
- { toolset: msvc-14.2, cxxstd: '14,17,20,latest', addrmd: '32,64', os: windows-2019, variant: 'debug,release' }
|
||||
- { toolset: msvc-14.3, cxxstd: '14,17,20,latest', addrmd: '32,64', os: windows-2022, variant: 'debug,release' }
|
||||
- { toolset: msvc-14.3, cxxstd: '14', addrmd: '64', os: windows-2022, variant: 'debug', defines: '_ALLOW_RTCc_IN_STL', cxxflags: '/RTCc' }
|
||||
- { toolset: msvc-14.3, cxxstd: '14', addrmd: '32', os: windows-2022, variant: 'debug', defines: '_ALLOW_RTCc_IN_STL', cxxflags: '"/RTCc /arch:IA32"' }
|
||||
- { toolset: clang-win, cxxstd: '14,17,latest', addrmd: '32,64', os: windows-2022, variant: 'debug,release' }
|
||||
- { toolset: gcc, cxxstd: '03,11,14,17,2a', addrmd: '64', os: windows-2019, variant: 'debug,release' }
|
||||
- { toolset: msvc-14.0, cxxstd: '14,latest', addrmd: '32,64', os: 'windows-2019', variant: 'debug,release' }
|
||||
- { toolset: msvc-14.2, cxxstd: '14,17,20,latest', addrmd: '32,64', os: 'windows-2019', variant: 'debug,release' }
|
||||
- { toolset: msvc-14.3, cxxstd: '14,17,20,latest', addrmd: '32,64', os: 'windows-2022', variant: 'debug,release' }
|
||||
- { toolset: msvc-14.3, cxxstd: '14', addrmd: '64', os: 'windows-2022', variant: 'debug', defines: '_ALLOW_RTCc_IN_STL', cxxflags: '/RTCc' }
|
||||
- { toolset: msvc-14.3, cxxstd: '14', addrmd: '32', os: 'windows-2022', variant: 'debug', defines: '_ALLOW_RTCc_IN_STL', cxxflags: '"/RTCc /arch:IA32"' }
|
||||
- { toolset: clang-win, cxxstd: '14,17,latest', addrmd: '32,64', os: 'windows-2022', variant: 'debug,release' }
|
||||
- { toolset: gcc, cxxstd: '03,11,14,17,2a', addrmd: '64', os: 'windows-2019', variant: 'debug,release' }
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
needs: [runner-selection]
|
||||
runs-on: ${{ fromJSON(needs.runner-selection.outputs.labelmatrix)[matrix.os] }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -294,7 +310,8 @@ jobs:
|
||||
- { sys: MINGW32, compiler: gcc, cxxstd: '03,11,17,20' }
|
||||
- { sys: MINGW64, compiler: gcc, cxxstd: '03,11,17,20' }
|
||||
|
||||
runs-on: windows-latest
|
||||
needs: [runner-selection]
|
||||
runs-on: ${{ fromJSON(needs.runner-selection.outputs.labelmatrix)['windows-latest'] }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -348,11 +365,12 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { os: ubuntu-20.04, build_shared: ON, build_type: Debug, generator: 'Unix Makefiles' }
|
||||
- { os: windows-2019, build_shared: ON, build_type: Debug, generator: 'Visual Studio 16 2019' }
|
||||
- { os: 'ubuntu-20.04', build_shared: ON, build_type: Debug, generator: 'Unix Makefiles' }
|
||||
- { os: 'windows-2019', build_shared: ON, build_type: Debug, generator: 'Visual Studio 16 2019' }
|
||||
|
||||
timeout-minutes: 120
|
||||
runs-on: ${{matrix.os}}
|
||||
needs: [runner-selection]
|
||||
runs-on: ${{ fromJSON(needs.runner-selection.outputs.labelmatrix)[matrix.os] }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 52 KiB |
@@ -298,7 +298,7 @@ The successful lookup benchmarks are done by looking up all `n` values, in their
|
||||
The unsuccessful lookup benchmarks use `n` randomly generated integers but using a different seed value.
|
||||
|
||||
|
||||
=== GCC 11, x64
|
||||
=== GCC 12, x64
|
||||
|
||||
|
||||
[caption=]
|
||||
@@ -317,7 +317,7 @@ h|unsuccessful lookup
|
||||
|
||||
|===
|
||||
|
||||
=== Clang 12, x64
|
||||
=== Clang 15, x64
|
||||
|
||||
|
||||
[caption=]
|
||||
@@ -336,7 +336,7 @@ h|unsuccessful lookup
|
||||
|
||||
|===
|
||||
|
||||
=== Visual Studio 2019, x64
|
||||
=== Visual Studio 2022, x64
|
||||
|
||||
|
||||
[caption=]
|
||||
@@ -374,7 +374,7 @@ h|unsuccessful lookup
|
||||
|
||||
|===
|
||||
|
||||
=== GCC 11, x86
|
||||
=== GCC 12, x86
|
||||
|
||||
|
||||
[caption=]
|
||||
@@ -393,7 +393,7 @@ h|unsuccessful lookup
|
||||
|
||||
|===
|
||||
|
||||
=== Clang 12, x86
|
||||
=== Clang 15, x86
|
||||
|
||||
|
||||
[caption=]
|
||||
@@ -412,7 +412,7 @@ h|unsuccessful lookup
|
||||
|
||||
|===
|
||||
|
||||
=== Visual Studio 2019, x86
|
||||
=== Visual Studio 2022, x86
|
||||
|
||||
|
||||
[caption=]
|
||||
|
||||
@@ -662,7 +662,7 @@ namespace boost {
|
||||
float max_load_factor() const noexcept
|
||||
{
|
||||
return table_.max_load_factor();
|
||||
};
|
||||
}
|
||||
void max_load_factor(float) {}
|
||||
size_type max_load() const noexcept { return table_.max_load(); }
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ struct group15
|
||||
std::size_t pos=reinterpret_cast<uintptr_t>(pc)%sizeof(group15);
|
||||
group15 *pg=reinterpret_cast<group15*>(pc-pos);
|
||||
return !pg->is_not_overflowed(*pc);
|
||||
};
|
||||
}
|
||||
|
||||
inline int match_available()const
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#define BOOST_UNORDERED_DETAIL_FOA_NODE_MAP_TYPES_HPP
|
||||
|
||||
#include <boost/core/allocator_access.hpp>
|
||||
#include <boost/core/no_exceptions_support.hpp>
|
||||
#include <boost/core/pointer_traits.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#define BOOST_UNORDERED_DETAIL_FOA_NODE_SET_TYPES_HPP
|
||||
|
||||
#include <boost/core/allocator_access.hpp>
|
||||
#include <boost/core/no_exceptions_support.hpp>
|
||||
#include <boost/core/pointer_traits.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
@@ -1624,7 +1624,7 @@ namespace boost {
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef std::forward_iterator_tag iterator_category;
|
||||
|
||||
iterator() : p(), itb(){};
|
||||
iterator() : p(), itb(){}
|
||||
|
||||
reference operator*() const BOOST_NOEXCEPT { return dereference(); }
|
||||
pointer operator->() const BOOST_NOEXCEPT
|
||||
@@ -1715,7 +1715,7 @@ namespace boost {
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef std::forward_iterator_tag iterator_category;
|
||||
|
||||
c_iterator() : p(), itb(){};
|
||||
c_iterator() : p(), itb(){}
|
||||
c_iterator(iterator<Node, Bucket> it) : p(it.p), itb(it.itb) {}
|
||||
|
||||
reference operator*() const BOOST_NOEXCEPT { return dereference(); }
|
||||
@@ -3393,7 +3393,7 @@ namespace boost {
|
||||
}
|
||||
}
|
||||
buckets_.unlink_empty_buckets();
|
||||
BOOST_RETHROW;
|
||||
BOOST_RETHROW
|
||||
}
|
||||
BOOST_CATCH_END
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ function(foa_tests)
|
||||
endfunction()
|
||||
|
||||
function(cfoa_tests)
|
||||
boost_test(PREFIX boost_unordered_cfoa LINK_LIBRARIES Threads::Threads ${ARGN})
|
||||
boost_test(PREFIX boost_unordered_cfoa LINK_LIBRARIES Boost::compat Threads::Threads ${ARGN})
|
||||
endfunction()
|
||||
|
||||
# FCA tests
|
||||
@@ -140,7 +140,6 @@ foa_tests(SOURCES exception/merge_exception_tests.cpp)
|
||||
|
||||
# CFOA tests
|
||||
|
||||
cfoa_tests(SOURCES cfoa/latch_tests.cpp)
|
||||
cfoa_tests(SOURCES cfoa/insert_tests.cpp)
|
||||
cfoa_tests(SOURCES cfoa/erase_tests.cpp)
|
||||
cfoa_tests(SOURCES cfoa/try_emplace_tests.cpp)
|
||||
@@ -159,5 +158,13 @@ cfoa_tests(SOURCES cfoa/exception_erase_tests.cpp)
|
||||
cfoa_tests(SOURCES cfoa/exception_constructor_tests.cpp)
|
||||
cfoa_tests(SOURCES cfoa/exception_assign_tests.cpp)
|
||||
cfoa_tests(SOURCES cfoa/exception_merge_tests.cpp)
|
||||
cfoa_tests(SOURCES cfoa/rw_spinlock_test.cpp)
|
||||
cfoa_tests(SOURCES cfoa/rw_spinlock_test2.cpp)
|
||||
cfoa_tests(SOURCES cfoa/rw_spinlock_test3.cpp)
|
||||
cfoa_tests(SOURCES cfoa/rw_spinlock_test4.cpp)
|
||||
cfoa_tests(SOURCES cfoa/rw_spinlock_test5.cpp)
|
||||
cfoa_tests(SOURCES cfoa/rw_spinlock_test6.cpp)
|
||||
cfoa_tests(SOURCES cfoa/rw_spinlock_test7.cpp)
|
||||
cfoa_tests(SOURCES cfoa/rw_spinlock_test8.cpp)
|
||||
|
||||
endif()
|
||||
|
||||
@@ -176,7 +176,6 @@ alias foa_tests :
|
||||
;
|
||||
|
||||
local CFOA_TESTS =
|
||||
latch_tests
|
||||
insert_tests
|
||||
erase_tests
|
||||
try_emplace_tests
|
||||
@@ -195,6 +194,14 @@ local CFOA_TESTS =
|
||||
exception_constructor_tests
|
||||
exception_assign_tests
|
||||
exception_merge_tests
|
||||
rw_spinlock_test
|
||||
rw_spinlock_test2
|
||||
rw_spinlock_test3
|
||||
rw_spinlock_test4
|
||||
rw_spinlock_test5
|
||||
rw_spinlock_test6
|
||||
rw_spinlock_test7
|
||||
rw_spinlock_test8
|
||||
;
|
||||
|
||||
for local test in $(CFOA_TESTS)
|
||||
|
||||
@@ -787,7 +787,7 @@ namespace {
|
||||
|
||||
std::thread t1, t2, t3;
|
||||
|
||||
boost::latch start_latch(2), end_latch(2);
|
||||
boost::compat::latch start_latch(2), end_latch(2);
|
||||
|
||||
auto v1 = make_random_values(1024 * 16, [&] { return gen(rg); });
|
||||
auto v2 = v1;
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
// Distributed under 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)
|
||||
|
||||
#include "latch.hpp"
|
||||
|
||||
#include "../helpers/generators.hpp"
|
||||
#include "../helpers/test.hpp"
|
||||
|
||||
#include <boost/compat/latch.hpp>
|
||||
#include <boost/container_hash/hash.hpp>
|
||||
#include <boost/core/span.hpp>
|
||||
#include <boost/unordered/unordered_flat_map.hpp>
|
||||
@@ -370,7 +369,7 @@ std::vector<boost::span<T> > split(
|
||||
|
||||
template <class T, class F> void thread_runner(std::vector<T>& values, F f)
|
||||
{
|
||||
boost::latch latch(static_cast<std::ptrdiff_t>(num_threads));
|
||||
boost::compat::latch latch(static_cast<std::ptrdiff_t>(num_threads));
|
||||
|
||||
std::vector<std::thread> threads;
|
||||
auto subslices = split<T>(values, num_threads);
|
||||
|
||||
@@ -5,11 +5,10 @@
|
||||
#ifndef BOOST_UNORDERED_TEST_CFOA_HELPERS_HPP
|
||||
#define BOOST_UNORDERED_TEST_CFOA_HELPERS_HPP
|
||||
|
||||
#include "latch.hpp"
|
||||
|
||||
#include "../helpers/generators.hpp"
|
||||
#include "../helpers/test.hpp"
|
||||
|
||||
#include <boost/compat/latch.hpp>
|
||||
#include <boost/container_hash/hash.hpp>
|
||||
#include <boost/core/span.hpp>
|
||||
#include <boost/unordered/unordered_flat_map.hpp>
|
||||
@@ -339,7 +338,7 @@ std::vector<boost::span<T> > split(
|
||||
|
||||
template <class T, class F> void thread_runner(std::vector<T>& values, F f)
|
||||
{
|
||||
boost::latch latch(static_cast<std::ptrdiff_t>(num_threads));
|
||||
boost::compat::latch latch(static_cast<std::ptrdiff_t>(num_threads));
|
||||
|
||||
std::vector<std::thread> threads;
|
||||
auto subslices = split<T>(values, num_threads);
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
// Copyright (C) 2023 Christian Mazakas
|
||||
// Distributed under 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)
|
||||
|
||||
#ifndef BOOST_UNORDERED_TEST_CFOA_LATCH_HPP
|
||||
#define BOOST_UNORDERED_TEST_CFOA_LATCH_HPP
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include <climits>
|
||||
#include <condition_variable>
|
||||
#include <cstddef>
|
||||
#include <mutex>
|
||||
|
||||
namespace boost {
|
||||
class latch
|
||||
{
|
||||
private:
|
||||
std::ptrdiff_t n_;
|
||||
mutable std::mutex m_;
|
||||
mutable std::condition_variable cv_;
|
||||
|
||||
public:
|
||||
explicit latch(std::ptrdiff_t expected) : n_{expected}, m_{}, cv_{}
|
||||
{
|
||||
BOOST_ASSERT(n_ >= 0);
|
||||
BOOST_ASSERT(n_ <= max());
|
||||
}
|
||||
|
||||
latch(latch const&) = delete;
|
||||
latch& operator=(latch const&) = delete;
|
||||
|
||||
~latch() = default;
|
||||
|
||||
void count_down(std::ptrdiff_t n = 1)
|
||||
{
|
||||
std::unique_lock<std::mutex> lk(m_);
|
||||
count_down_and_notify(lk, n);
|
||||
}
|
||||
|
||||
bool try_wait() const noexcept
|
||||
{
|
||||
std::unique_lock<std::mutex> lk(m_);
|
||||
return is_ready();
|
||||
}
|
||||
|
||||
void wait() const
|
||||
{
|
||||
std::unique_lock<std::mutex> lk(m_);
|
||||
wait_impl(lk);
|
||||
}
|
||||
|
||||
void arrive_and_wait(std::ptrdiff_t n = 1)
|
||||
{
|
||||
std::unique_lock<std::mutex> lk(m_);
|
||||
bool should_wait = count_down_and_notify(lk, n);
|
||||
if (should_wait) {
|
||||
wait_impl(lk);
|
||||
}
|
||||
}
|
||||
|
||||
static constexpr std::ptrdiff_t max() noexcept { return INT_MAX; }
|
||||
|
||||
private:
|
||||
bool is_ready() const { return n_ == 0; }
|
||||
|
||||
bool count_down_and_notify(
|
||||
std::unique_lock<std::mutex>& lk, std::ptrdiff_t n)
|
||||
{
|
||||
n_ -= n;
|
||||
if (n_ == 0) {
|
||||
lk.unlock();
|
||||
cv_.notify_all();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void wait_impl(std::unique_lock<std::mutex>& lk) const
|
||||
{
|
||||
cv_.wait(lk, [this] { return this->is_ready(); });
|
||||
}
|
||||
};
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNORDERED_TEST_CFOA_LATCH_HPP
|
||||
@@ -1,155 +0,0 @@
|
||||
// Copyright (C) 2023 Christian Mazakas
|
||||
// Distributed under 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)
|
||||
|
||||
#define BOOST_ENABLE_ASSERT_HANDLER
|
||||
|
||||
#include "latch.hpp"
|
||||
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
struct exception
|
||||
{
|
||||
};
|
||||
|
||||
namespace boost {
|
||||
void assertion_failed(
|
||||
char const* expr, char const* function, char const* file, long line)
|
||||
{
|
||||
(void)expr;
|
||||
(void)function;
|
||||
(void)file;
|
||||
(void)line;
|
||||
throw exception{};
|
||||
}
|
||||
} // namespace boost
|
||||
|
||||
namespace {
|
||||
void test_max() { BOOST_TEST_EQ(boost::latch::max(), INT_MAX); }
|
||||
|
||||
void test_constructor()
|
||||
{
|
||||
{
|
||||
auto const f = [] {
|
||||
boost::latch l(-1);
|
||||
(void)l;
|
||||
};
|
||||
BOOST_TEST_THROWS(f(), exception);
|
||||
}
|
||||
|
||||
{
|
||||
std::ptrdiff_t n = 0;
|
||||
|
||||
boost::latch l(n);
|
||||
BOOST_TEST(l.try_wait());
|
||||
}
|
||||
|
||||
{
|
||||
std::ptrdiff_t n = 16;
|
||||
|
||||
boost::latch l(n);
|
||||
BOOST_TEST_NOT(l.try_wait());
|
||||
|
||||
l.count_down(16);
|
||||
BOOST_TEST(l.try_wait());
|
||||
}
|
||||
|
||||
#if PTRDIFF_MAX > INT_MAX
|
||||
{
|
||||
auto const f = [] {
|
||||
std::ptrdiff_t n = INT_MAX;
|
||||
n += 10;
|
||||
boost::latch l(n);
|
||||
(void)l;
|
||||
};
|
||||
BOOST_TEST_THROWS(f(), exception);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void test_count_down_and_wait()
|
||||
{
|
||||
constexpr std::ptrdiff_t n = 1024;
|
||||
|
||||
boost::latch l(2 * n);
|
||||
|
||||
bool bs[] = {false, false};
|
||||
|
||||
std::thread t1([&] {
|
||||
l.wait();
|
||||
BOOST_TEST(bs[0]);
|
||||
BOOST_TEST(bs[1]);
|
||||
});
|
||||
|
||||
std::thread t2([&] {
|
||||
for (int i = 0; i < n; ++i) {
|
||||
if (i == (n - 1)) {
|
||||
bs[0] = true;
|
||||
} else {
|
||||
BOOST_TEST_NOT(l.try_wait());
|
||||
}
|
||||
|
||||
l.count_down(1);
|
||||
}
|
||||
});
|
||||
|
||||
for (int i = 0; i < n; ++i) {
|
||||
if (i == (n - 1)) {
|
||||
bs[1] = true;
|
||||
} else {
|
||||
BOOST_TEST_NOT(l.try_wait());
|
||||
}
|
||||
|
||||
l.count_down(1);
|
||||
}
|
||||
|
||||
t1.join();
|
||||
t2.join();
|
||||
|
||||
BOOST_TEST(l.try_wait());
|
||||
}
|
||||
|
||||
void test_arrive_and_wait()
|
||||
{
|
||||
std::ptrdiff_t const n = 16;
|
||||
|
||||
boost::latch l(2 * n);
|
||||
|
||||
int xs[n] = {0};
|
||||
|
||||
std::vector<std::thread> threads;
|
||||
for (int i = 0; i < n; ++i) {
|
||||
threads.emplace_back([&l, &xs, i, n] {
|
||||
(void)n;
|
||||
for (int j = 0; j < n; ++j) {
|
||||
BOOST_TEST_EQ(xs[j], 0);
|
||||
}
|
||||
|
||||
l.arrive_and_wait(2);
|
||||
|
||||
xs[i] = 1;
|
||||
});
|
||||
}
|
||||
|
||||
for (auto& t : threads) {
|
||||
t.join();
|
||||
}
|
||||
|
||||
for (int i = 0; i < n; ++i) {
|
||||
BOOST_TEST_EQ(xs[i], 1);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
int main()
|
||||
{
|
||||
test_max();
|
||||
test_constructor();
|
||||
test_count_down_and_wait();
|
||||
test_arrive_and_wait();
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
@@ -103,7 +103,7 @@ namespace {
|
||||
map2_type x2(2 * vals1.size(), allocator_type(3));
|
||||
|
||||
std::thread t1, t2, t3;
|
||||
boost::latch l(2);
|
||||
boost::compat::latch l(2);
|
||||
|
||||
std::mutex m;
|
||||
std::condition_variable cv;
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace {
|
||||
map_type x(0, hasher(1), key_equal(2), allocator_type(3));
|
||||
|
||||
std::thread t1, t2, t3;
|
||||
boost::latch l(2);
|
||||
boost::compat::latch l(2);
|
||||
|
||||
std::mutex m;
|
||||
std::condition_variable cv;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
// Copyright 2023 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/unordered/detail/foa/rw_spinlock.hpp>
|
||||
#include <mutex>
|
||||
|
||||
using boost::unordered::detail::foa::rw_spinlock;
|
||||
|
||||
// Sanity check only
|
||||
|
||||
static rw_spinlock sp;
|
||||
static rw_spinlock sp2;
|
||||
|
||||
int main()
|
||||
{
|
||||
sp.lock();
|
||||
sp2.lock();
|
||||
sp.unlock();
|
||||
sp2.unlock();
|
||||
|
||||
{
|
||||
std::lock_guard<rw_spinlock> lock( sp );
|
||||
std::lock_guard<rw_spinlock> lock2( sp2 );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// Copyright 2023 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/unordered/detail/foa/rw_spinlock.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <mutex>
|
||||
|
||||
using boost::unordered::detail::foa::rw_spinlock;
|
||||
|
||||
static rw_spinlock sp;
|
||||
static rw_spinlock sp2;
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST( sp.try_lock() );
|
||||
BOOST_TEST( !sp.try_lock() );
|
||||
BOOST_TEST( sp2.try_lock() );
|
||||
BOOST_TEST( !sp.try_lock() );
|
||||
BOOST_TEST( !sp2.try_lock() );
|
||||
sp.unlock();
|
||||
sp2.unlock();
|
||||
|
||||
sp.lock();
|
||||
BOOST_TEST( !sp.try_lock() );
|
||||
sp2.lock();
|
||||
BOOST_TEST( !sp.try_lock() );
|
||||
BOOST_TEST( !sp2.try_lock() );
|
||||
sp.unlock();
|
||||
sp2.unlock();
|
||||
|
||||
{
|
||||
std::lock_guard<rw_spinlock> lock( sp );
|
||||
BOOST_TEST( !sp.try_lock() );
|
||||
std::lock_guard<rw_spinlock> lock2( sp2 );
|
||||
BOOST_TEST( !sp.try_lock() );
|
||||
BOOST_TEST( !sp2.try_lock() );
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
// Copyright 2023 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/unordered/detail/foa/rw_spinlock.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <cstdio>
|
||||
|
||||
using boost::unordered::detail::foa::rw_spinlock;
|
||||
|
||||
static int count = 0;
|
||||
static rw_spinlock sp;
|
||||
|
||||
void f( int k, int n )
|
||||
{
|
||||
std::printf( "Thread %d started.\n", k );
|
||||
|
||||
for( int i = 0; i < n; ++i )
|
||||
{
|
||||
std::lock_guard<rw_spinlock> lock( sp );
|
||||
++count;
|
||||
}
|
||||
|
||||
std::printf( "Thread %d finished.\n", k );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int const N = 1000000; // iterations
|
||||
int const M = 8; // threads
|
||||
|
||||
std::thread th[ M ];
|
||||
|
||||
for( int i = 0; i < M; ++i )
|
||||
{
|
||||
th[ i ] = std::thread( f, i, N );
|
||||
}
|
||||
|
||||
for( int i = 0; i < M; ++i )
|
||||
{
|
||||
th[ i ].join();
|
||||
}
|
||||
|
||||
BOOST_TEST_EQ( count, N * M );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// Copyright 2023 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/unordered/detail/foa/rw_spinlock.hpp>
|
||||
#include <boost/compat/shared_lock.hpp>
|
||||
#include <mutex>
|
||||
|
||||
using boost::unordered::detail::foa::rw_spinlock;
|
||||
|
||||
static rw_spinlock sp;
|
||||
static rw_spinlock sp2;
|
||||
|
||||
int main()
|
||||
{
|
||||
sp.lock();
|
||||
sp2.lock_shared();
|
||||
sp2.lock_shared();
|
||||
|
||||
sp.unlock();
|
||||
sp2.unlock_shared();
|
||||
sp2.unlock_shared();
|
||||
|
||||
{
|
||||
std::lock_guard<rw_spinlock> lock( sp );
|
||||
boost::compat::shared_lock<rw_spinlock> lock2( sp2 );
|
||||
boost::compat::shared_lock<rw_spinlock> lock3( sp2 );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// Copyright 2023 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/unordered/detail/foa/rw_spinlock.hpp>
|
||||
#include <boost/compat/shared_lock.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <mutex>
|
||||
|
||||
using boost::unordered::detail::foa::rw_spinlock;
|
||||
|
||||
static rw_spinlock sp;
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
BOOST_TEST( sp.try_lock_shared() );
|
||||
BOOST_TEST( sp.try_lock_shared() );
|
||||
sp.unlock_shared();
|
||||
sp.unlock_shared();
|
||||
}
|
||||
|
||||
{
|
||||
BOOST_TEST( sp.try_lock() );
|
||||
BOOST_TEST( !sp.try_lock_shared() );
|
||||
sp.unlock();
|
||||
}
|
||||
|
||||
{
|
||||
std::lock_guard<rw_spinlock> lock( sp );
|
||||
BOOST_TEST( !sp.try_lock_shared() );
|
||||
}
|
||||
|
||||
{
|
||||
boost::compat::shared_lock<rw_spinlock> lock( sp );
|
||||
BOOST_TEST( !sp.try_lock() );
|
||||
BOOST_TEST( sp.try_lock_shared() );
|
||||
sp.unlock_shared();
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
// Copyright 2023 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/unordered/detail/foa/rw_spinlock.hpp>
|
||||
#include <boost/compat/shared_lock.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <cstdio>
|
||||
|
||||
using boost::unordered::detail::foa::rw_spinlock;
|
||||
|
||||
static int count = 0;
|
||||
static rw_spinlock sp;
|
||||
|
||||
void f( int k, int n )
|
||||
{
|
||||
std::printf( "Thread %d started.\n", k );
|
||||
|
||||
int i = 0;
|
||||
|
||||
for( ;; ++i )
|
||||
{
|
||||
{
|
||||
boost::compat::shared_lock<rw_spinlock> lock( sp );
|
||||
if( count >= n ) break;
|
||||
}
|
||||
|
||||
{
|
||||
std::lock_guard<rw_spinlock> lock( sp );
|
||||
if( count >= n ) break;
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
std::printf( "Thread %d finished (%i iterations).\n", k, i );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int const N = 1000000; // total iterations
|
||||
int const M = 8; // threads
|
||||
|
||||
std::thread th[ M ];
|
||||
|
||||
for( int i = 0; i < M; ++i )
|
||||
{
|
||||
th[ i ] = std::thread( f, i, N );
|
||||
}
|
||||
|
||||
for( int i = 0; i < M; ++i )
|
||||
{
|
||||
th[ i ].join();
|
||||
}
|
||||
|
||||
BOOST_TEST_EQ( count, N );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
// Copyright 2023 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/unordered/detail/foa/rw_spinlock.hpp>
|
||||
#include <boost/compat/shared_lock.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <cstdio>
|
||||
|
||||
using boost::unordered::detail::foa::rw_spinlock;
|
||||
|
||||
static int count = 0;
|
||||
static rw_spinlock sp;
|
||||
|
||||
void f( int k, int n )
|
||||
{
|
||||
std::printf( "Thread %d started.\n", k );
|
||||
|
||||
int i = 0;
|
||||
|
||||
for( ;; ++i )
|
||||
{
|
||||
int oldc;
|
||||
|
||||
{
|
||||
boost::compat::shared_lock<rw_spinlock> lock( sp );
|
||||
if( count >= n ) break;
|
||||
oldc = count;
|
||||
}
|
||||
|
||||
{
|
||||
std::lock_guard<rw_spinlock> lock( sp );
|
||||
if( count == oldc ) ++count;
|
||||
}
|
||||
}
|
||||
|
||||
std::printf( "Thread %d finished (%i iterations).\n", k, i );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int const N = 1000000; // total iterations
|
||||
int const M = 8; // threads
|
||||
|
||||
std::thread th[ M ];
|
||||
|
||||
for( int i = 0; i < M; ++i )
|
||||
{
|
||||
th[ i ] = std::thread( f, i, N );
|
||||
}
|
||||
|
||||
for( int i = 0; i < M; ++i )
|
||||
{
|
||||
th[ i ].join();
|
||||
}
|
||||
|
||||
BOOST_TEST_EQ( count, N );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
// Copyright 2023 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/unordered/detail/foa/rw_spinlock.hpp>
|
||||
#include <boost/compat/shared_lock.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <cstdio>
|
||||
|
||||
using boost::unordered::detail::foa::rw_spinlock;
|
||||
|
||||
static int count = 0;
|
||||
static rw_spinlock sp;
|
||||
|
||||
void f( int k, int m, int n )
|
||||
{
|
||||
std::printf( "Thread %d of %d started.\n", k, m );
|
||||
|
||||
for( int i = 0; i < n; ++i )
|
||||
{
|
||||
int oldc;
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
{
|
||||
boost::compat::shared_lock<rw_spinlock> lock( sp );
|
||||
oldc = count;
|
||||
}
|
||||
|
||||
if( oldc % m == k ) break;
|
||||
}
|
||||
|
||||
{
|
||||
std::lock_guard<rw_spinlock> lock( sp );
|
||||
if( count == oldc ) ++count;
|
||||
}
|
||||
}
|
||||
|
||||
std::printf( "Thread %d of %d finished.\n", k, m );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int const N = 100; // total iterations
|
||||
int const M = 4; // threads
|
||||
|
||||
std::thread th[ M ];
|
||||
|
||||
for( int i = 0; i < M; ++i )
|
||||
{
|
||||
th[ i ] = std::thread( f, i, M, N );
|
||||
}
|
||||
|
||||
for( int i = 0; i < M; ++i )
|
||||
{
|
||||
th[ i ].join();
|
||||
}
|
||||
|
||||
BOOST_TEST_EQ( count, N * M );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
@@ -190,7 +190,7 @@ namespace {
|
||||
map_type x2(vals2.size(), hasher(2), key_equal(1), allocator_type(3));
|
||||
|
||||
std::thread t1, t2, t3;
|
||||
boost::latch l(2);
|
||||
boost::compat::latch l(2);
|
||||
|
||||
std::mutex m;
|
||||
std::condition_variable cv;
|
||||
|
||||
@@ -520,7 +520,7 @@ namespace {
|
||||
X x;
|
||||
|
||||
std::thread t1, t2;
|
||||
boost::latch l(2);
|
||||
boost::compat::latch l(2);
|
||||
std::vector<std::string> strs(values.size());
|
||||
|
||||
t1 = std::thread([&l, &values, &x, &strs] {
|
||||
|
||||
@@ -84,7 +84,7 @@ void insert_exception_test(T*, Inserter insert, test::random_generator gen)
|
||||
test::random_values<T> v(10, gen);
|
||||
T x;
|
||||
|
||||
EXCEPTION_LOOP(insert_exception_test_impl(x, generate(insert, x), v));
|
||||
EXCEPTION_LOOP(insert_exception_test_impl(x, generate(insert, x), v))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ void insert_rehash_exception_test(
|
||||
rehash_prep(x);
|
||||
|
||||
test::random_values<T> v2(5, gen);
|
||||
EXCEPTION_LOOP(insert_exception_test_impl(x, generate(insert, x), v2));
|
||||
EXCEPTION_LOOP(insert_exception_test_impl(x, generate(insert, x), v2))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ void insert_range_exception_test(T*, test::random_generator gen)
|
||||
test::random_values<T> v(10, gen);
|
||||
T x;
|
||||
|
||||
EXCEPTION_LOOP(insert_range_exception_test_impl(x, v));
|
||||
EXCEPTION_LOOP(insert_range_exception_test_impl(x, v))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,7 +470,7 @@ void insert_range_rehash_exception_test(T*, test::random_generator gen)
|
||||
rehash_prep(x);
|
||||
|
||||
test::random_values<T> v2(5, gen);
|
||||
EXCEPTION_LOOP(insert_range_exception_test_impl(x, v2));
|
||||
EXCEPTION_LOOP(insert_range_exception_test_impl(x, v2))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace test {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
// Check that size matches up.
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(object::object())
|
||||
{
|
||||
UNORDERED_EPOINT("Mock object default constructor.");
|
||||
UNORDERED_EPOINT("Mock object default constructor.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(object::object(int))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock object constructor by value.");
|
||||
UNORDERED_EPOINT("Mock object constructor by value.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(object::object(object))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock object copy constructor.");
|
||||
UNORDERED_EPOINT("Mock object copy constructor.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace test {
|
||||
UNORDERED_SCOPE(object::operator=(object))
|
||||
{
|
||||
tag1_ = x.tag1_;
|
||||
UNORDERED_EPOINT("Mock object assign operator 1.");
|
||||
UNORDERED_EPOINT("Mock object assign operator 1.")
|
||||
tag2_ = x.tag2_;
|
||||
// UNORDERED_EPOINT("Mock object assign operator 2.");
|
||||
}
|
||||
@@ -96,7 +96,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(operator==(object, object))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock object equality operator.");
|
||||
UNORDERED_EPOINT("Mock object equality operator.")
|
||||
}
|
||||
|
||||
return x1.tag1_ == x2.tag1_ && x1.tag2_ == x2.tag2_;
|
||||
@@ -106,7 +106,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(operator!=(object, object))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock object inequality operator.");
|
||||
UNORDERED_EPOINT("Mock object inequality operator.")
|
||||
}
|
||||
|
||||
return !(x1.tag1_ == x2.tag1_ && x1.tag2_ == x2.tag2_);
|
||||
@@ -150,7 +150,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(hash::object())
|
||||
{
|
||||
UNORDERED_EPOINT("Mock hash default constructor.");
|
||||
UNORDERED_EPOINT("Mock hash default constructor.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(hash::hash(hash))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock hash copy constructor.");
|
||||
UNORDERED_EPOINT("Mock hash copy constructor.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,9 +166,9 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(hash::operator=(hash))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock hash assign operator 1.");
|
||||
UNORDERED_EPOINT("Mock hash assign operator 1.")
|
||||
tag_ = x.tag_;
|
||||
UNORDERED_EPOINT("Mock hash assign operator 2.");
|
||||
UNORDERED_EPOINT("Mock hash assign operator 2.")
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -177,7 +177,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(hash::operator()(object))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock hash function.");
|
||||
UNORDERED_EPOINT("Mock hash function.")
|
||||
}
|
||||
|
||||
return hash_impl(x);
|
||||
@@ -187,7 +187,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(hash::operator()(std::pair<object, object>))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock hash pair function.");
|
||||
UNORDERED_EPOINT("Mock hash pair function.")
|
||||
}
|
||||
|
||||
return hash_impl(x.first) * 193ul + hash_impl(x.second) * 97ul + 29ul;
|
||||
@@ -214,7 +214,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(operator==(hash, hash))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock hash equality function.");
|
||||
UNORDERED_EPOINT("Mock hash equality function.")
|
||||
}
|
||||
return x1.tag_ == x2.tag_;
|
||||
}
|
||||
@@ -223,7 +223,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(hash::operator!=(hash, hash))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock hash inequality function.");
|
||||
UNORDERED_EPOINT("Mock hash inequality function.")
|
||||
}
|
||||
return x1.tag_ != x2.tag_;
|
||||
}
|
||||
@@ -300,7 +300,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(equal_to::equal_to())
|
||||
{
|
||||
UNORDERED_EPOINT("Mock equal_to default constructor.");
|
||||
UNORDERED_EPOINT("Mock equal_to default constructor.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(equal_to::equal_to(equal_to))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock equal_to copy constructor.");
|
||||
UNORDERED_EPOINT("Mock equal_to copy constructor.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,9 +316,9 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(equal_to::operator=(equal_to))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock equal_to assign operator 1.");
|
||||
UNORDERED_EPOINT("Mock equal_to assign operator 1.")
|
||||
tag_ = x.tag_;
|
||||
UNORDERED_EPOINT("Mock equal_to assign operator 2.");
|
||||
UNORDERED_EPOINT("Mock equal_to assign operator 2.")
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -327,7 +327,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(equal_to::operator()(object, object))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock equal_to function.");
|
||||
UNORDERED_EPOINT("Mock equal_to function.")
|
||||
}
|
||||
|
||||
return equal_impl(x1, x2);
|
||||
@@ -339,7 +339,7 @@ namespace test {
|
||||
UNORDERED_SCOPE(equal_to::operator()(
|
||||
std::pair<object, object>, std::pair<object, object>))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock equal_to function.");
|
||||
UNORDERED_EPOINT("Mock equal_to function.")
|
||||
}
|
||||
|
||||
return equal_impl(x1.first, x2.first) &&
|
||||
@@ -362,7 +362,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(operator==(equal_to, equal_to))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock equal_to equality function.");
|
||||
UNORDERED_EPOINT("Mock equal_to equality function.")
|
||||
}
|
||||
return x1.tag_ == x2.tag_;
|
||||
}
|
||||
@@ -371,7 +371,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(operator!=(equal_to, equal_to))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock equal_to inequality function.");
|
||||
UNORDERED_EPOINT("Mock equal_to inequality function.")
|
||||
}
|
||||
return x1.tag_ != x2.tag_;
|
||||
}
|
||||
@@ -412,7 +412,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(allocator::allocator())
|
||||
{
|
||||
UNORDERED_EPOINT("Mock allocator default constructor.");
|
||||
UNORDERED_EPOINT("Mock allocator default constructor.")
|
||||
}
|
||||
test::detail::tracker.allocator_ref();
|
||||
}
|
||||
@@ -460,7 +460,7 @@ namespace test {
|
||||
T* ptr = 0;
|
||||
UNORDERED_SCOPE(allocator::allocate(size_type))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock allocator allocate function.");
|
||||
UNORDERED_EPOINT("Mock allocator allocate function.")
|
||||
|
||||
using namespace std;
|
||||
ptr = (T*)malloc(n * sizeof(T));
|
||||
@@ -478,7 +478,7 @@ namespace test {
|
||||
T* ptr = 0;
|
||||
UNORDERED_SCOPE(allocator::allocate(size_type, const_pointer))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock allocator allocate function.");
|
||||
UNORDERED_EPOINT("Mock allocator allocate function.")
|
||||
|
||||
using namespace std;
|
||||
ptr = (T*)malloc(n * sizeof(T));
|
||||
@@ -507,7 +507,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(allocator::construct(U*, Arg))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock allocator construct function.");
|
||||
UNORDERED_EPOINT("Mock allocator construct function.")
|
||||
new (p) U(t);
|
||||
}
|
||||
test::detail::tracker.track_construct((void*)p, sizeof(U), tag_);
|
||||
@@ -517,7 +517,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(allocator::construct(U*, BOOST_FWD_REF(Args)...))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock allocator construct function.");
|
||||
UNORDERED_EPOINT("Mock allocator construct function.")
|
||||
new (p) U(boost::forward<Args>(args)...);
|
||||
}
|
||||
test::detail::tracker.track_construct((void*)p, sizeof(U), tag_);
|
||||
@@ -535,7 +535,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(allocator::construct(pointer, T))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock allocator max_size function.");
|
||||
UNORDERED_EPOINT("Mock allocator max_size function.")
|
||||
}
|
||||
return (std::numeric_limits<std::size_t>::max)();
|
||||
}
|
||||
@@ -592,7 +592,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(allocator2::allocator2())
|
||||
{
|
||||
UNORDERED_EPOINT("Mock allocator2 default constructor.");
|
||||
UNORDERED_EPOINT("Mock allocator2 default constructor.")
|
||||
}
|
||||
test::detail::tracker.allocator_ref();
|
||||
}
|
||||
@@ -641,7 +641,7 @@ namespace test {
|
||||
T* ptr = 0;
|
||||
UNORDERED_SCOPE(allocator2::allocate(size_type))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock allocator2 allocate function.");
|
||||
UNORDERED_EPOINT("Mock allocator2 allocate function.")
|
||||
|
||||
using namespace std;
|
||||
ptr = (T*)malloc(n * sizeof(T));
|
||||
@@ -659,7 +659,7 @@ namespace test {
|
||||
T* ptr = 0;
|
||||
UNORDERED_SCOPE(allocator2::allocate(size_type, const_pointer))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock allocator2 allocate function.");
|
||||
UNORDERED_EPOINT("Mock allocator2 allocate function.")
|
||||
|
||||
using namespace std;
|
||||
ptr = (T*)malloc(n * sizeof(T));
|
||||
@@ -688,7 +688,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(allocator2::construct(U*, V))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock allocator2 construct function.");
|
||||
UNORDERED_EPOINT("Mock allocator2 construct function.")
|
||||
new (p) U(v);
|
||||
}
|
||||
test::detail::tracker.track_construct((void*)p, sizeof(U), tag_);
|
||||
@@ -699,7 +699,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(allocator2::construct(U*, BOOST_FWD_REF(Args)...))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock allocator2 construct function.");
|
||||
UNORDERED_EPOINT("Mock allocator2 construct function.")
|
||||
new (p) U(boost::forward<Args>(args)...);
|
||||
}
|
||||
test::detail::tracker.track_construct((void*)p, sizeof(U), tag_);
|
||||
@@ -717,7 +717,7 @@ namespace test {
|
||||
{
|
||||
UNORDERED_SCOPE(allocator2::construct(pointer, T))
|
||||
{
|
||||
UNORDERED_EPOINT("Mock allocator2 max_size function.");
|
||||
UNORDERED_EPOINT("Mock allocator2 max_size function.")
|
||||
}
|
||||
return (std::numeric_limits<std::size_t>::max)();
|
||||
}
|
||||
|
||||