mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-10-04 19:51:02 +02:00
Compare commits
56 Commits
boost-1.77
...
feature/dr
Author | SHA1 | Date | |
---|---|---|---|
|
e9790f99f7 | ||
|
c8ef3e2276 | ||
|
1650077eee | ||
|
635dfe46ee | ||
|
c4ae5e0c42 | ||
|
85b0ab073c | ||
|
3ef8cfd02f | ||
|
cd2aac8442 | ||
|
3ca07d82a7 | ||
|
f8303629f1 | ||
|
ef0e40bcda | ||
|
4af91d46f1 | ||
|
42dfdc9e51 | ||
|
763c7f56cd | ||
|
029f089a4a | ||
|
66d11714bd | ||
|
ac0381f0b8 | ||
|
13be03abf8 | ||
|
5e7596ef06 | ||
|
ef1651449f | ||
|
b34786c4d4 | ||
|
aacfb25c82 | ||
|
c7349834be | ||
|
414b0a65d9 | ||
|
bcb2566e74 | ||
|
7070f9b3f8 | ||
|
78fd14f412 | ||
|
861622d329 | ||
|
366c60ad3b | ||
|
331c50132b | ||
|
97c9204a95 | ||
|
c577d68b02 | ||
|
2ce29622f5 | ||
|
7e9c54ffa2 | ||
|
ca8d5216fc | ||
|
79e46f1719 | ||
|
e6b5dc5ada | ||
|
dd57aa5b70 | ||
|
e4637b8500 | ||
|
a0d4ec3915 | ||
|
59b5b17e81 | ||
|
f2ab3b21f0 | ||
|
e04196b6a1 | ||
|
95eaa2d7c3 | ||
|
2e31d0d633 | ||
|
b8cb132ab4 | ||
|
f4d7116241 | ||
|
f2cc84a23c | ||
|
f12a33813d | ||
|
cfde4f7407 | ||
|
b8d340b495 | ||
|
6716193d9c | ||
|
8f40bff2f6 | ||
|
1ef8f4e72d | ||
|
f651a49d96 | ||
|
598314b8e1 |
439
.drone.jsonnet
Normal file
439
.drone.jsonnet
Normal file
@@ -0,0 +1,439 @@
|
|||||||
|
# Copyright 2022 Peter Dimov
|
||||||
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
|
# https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
local library = "smart_ptr";
|
||||||
|
|
||||||
|
local triggers =
|
||||||
|
{
|
||||||
|
branch: [ "master", "develop", "feature/*" ]
|
||||||
|
};
|
||||||
|
|
||||||
|
local ubsan = { UBSAN: '1', UBSAN_OPTIONS: 'print_stacktrace=1' };
|
||||||
|
local asan = { ASAN: '1' };
|
||||||
|
|
||||||
|
local linux_pipeline(name, image, environment, packages = "", sources = [], arch = "amd64") =
|
||||||
|
{
|
||||||
|
name: name,
|
||||||
|
kind: "pipeline",
|
||||||
|
type: "docker",
|
||||||
|
trigger: triggers,
|
||||||
|
platform:
|
||||||
|
{
|
||||||
|
os: "linux",
|
||||||
|
arch: arch
|
||||||
|
},
|
||||||
|
steps:
|
||||||
|
[
|
||||||
|
{
|
||||||
|
name: "everything",
|
||||||
|
image: image,
|
||||||
|
environment: environment,
|
||||||
|
commands:
|
||||||
|
[
|
||||||
|
'set -e',
|
||||||
|
'uname -a',
|
||||||
|
'echo $DRONE_STAGE_MACHINE',
|
||||||
|
'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -',
|
||||||
|
] +
|
||||||
|
(if sources != [] then [ ('apt-add-repository "' + source + '"') for source in sources ] else []) +
|
||||||
|
(if packages != "" then [ 'apt-get update', 'apt-get -y install ' + packages ] else []) +
|
||||||
|
[
|
||||||
|
'export LIBRARY=' + library,
|
||||||
|
'./.drone/drone.sh',
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
local macos_pipeline(name, environment, xcode_version = "12.2", osx_version = "catalina", arch = "amd64") =
|
||||||
|
{
|
||||||
|
name: name,
|
||||||
|
kind: "pipeline",
|
||||||
|
type: "exec",
|
||||||
|
trigger: triggers,
|
||||||
|
platform: {
|
||||||
|
"os": "darwin",
|
||||||
|
"arch": arch
|
||||||
|
},
|
||||||
|
node: {
|
||||||
|
"os": osx_version
|
||||||
|
},
|
||||||
|
steps: [
|
||||||
|
{
|
||||||
|
name: "everything",
|
||||||
|
environment: environment + { "DEVELOPER_DIR": "/Applications/Xcode-" + xcode_version + ".app/Contents/Developer" },
|
||||||
|
commands:
|
||||||
|
[
|
||||||
|
'export LIBRARY=' + library,
|
||||||
|
'./.drone/drone.sh',
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
local windows_pipeline(name, image, environment, arch = "amd64") =
|
||||||
|
{
|
||||||
|
name: name,
|
||||||
|
kind: "pipeline",
|
||||||
|
type: "docker",
|
||||||
|
trigger: triggers,
|
||||||
|
platform:
|
||||||
|
{
|
||||||
|
os: "windows",
|
||||||
|
arch: arch
|
||||||
|
},
|
||||||
|
"steps":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
name: "everything",
|
||||||
|
image: image,
|
||||||
|
environment: environment,
|
||||||
|
commands:
|
||||||
|
[
|
||||||
|
'cmd /C .drone\\\\drone.bat ' + library,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
[
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 14.04 GCC 4.4",
|
||||||
|
"cppalliance/droneubuntu1404:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-4.4', CXXSTD: '98,0x' },
|
||||||
|
"g++-4.4",
|
||||||
|
[ "ppa:ubuntu-toolchain-r/test" ],
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 14.04 GCC 4.6",
|
||||||
|
"cppalliance/droneubuntu1404:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-4.6', CXXSTD: '98,0x' },
|
||||||
|
"g++-4.6",
|
||||||
|
[ "ppa:ubuntu-toolchain-r/test" ],
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 14.04 GCC 4.7",
|
||||||
|
"cppalliance/droneubuntu1404:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-4.7', CXXSTD: '98,0x' },
|
||||||
|
"g++-4.7",
|
||||||
|
[ "ppa:ubuntu-toolchain-r/test" ],
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 14.04 GCC 4.8*",
|
||||||
|
"cppalliance/droneubuntu1404:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11' },
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 14.04 GCC 4.9",
|
||||||
|
"cppalliance/droneubuntu1404:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-4.9', CXXSTD: '03,11' },
|
||||||
|
"g++-4.9",
|
||||||
|
[ "ppa:ubuntu-toolchain-r/test" ],
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 16.04 GCC 5*",
|
||||||
|
"cppalliance/droneubuntu1604:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14' },
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 18.04 GCC 6",
|
||||||
|
"cppalliance/droneubuntu1804:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-6', CXXSTD: '03,11,14' },
|
||||||
|
"g++-6",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 18.04 GCC 7* 32/64",
|
||||||
|
"cppalliance/droneubuntu1804:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17', ADDRMD: '32,64' },
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 18.04 GCC 8 32/64",
|
||||||
|
"cppalliance/droneubuntu1804:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-8', CXXSTD: '03,11,14,17', ADDRMD: '32,64' },
|
||||||
|
"g++-8-multilib",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 GCC 9* 32/64",
|
||||||
|
"cppalliance/droneubuntu2004:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '32,64' },
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 GCC 9* ARM64",
|
||||||
|
"cppalliance/droneubuntu2004:multiarch",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a' },
|
||||||
|
arch="arm64",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 GCC 9* S390x",
|
||||||
|
"cppalliance/droneubuntu2004:multiarch",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a' },
|
||||||
|
arch="s390x",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 GCC 10 32/64",
|
||||||
|
"cppalliance/droneubuntu2004:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-10', CXXSTD: '03,11,14,17,20', ADDRMD: '32,64' },
|
||||||
|
"g++-10-multilib",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 22.04 GCC 11* 32/64",
|
||||||
|
"cppalliance/droneubuntu2204:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '32,64' },
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 22.04 GCC 12 32/64",
|
||||||
|
"cppalliance/droneubuntu2204:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32,64' },
|
||||||
|
"g++-12-multilib",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 23.04 GCC 13 32 ASAN",
|
||||||
|
"cppalliance/droneubuntu2304:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32' } + asan,
|
||||||
|
"g++-13-multilib",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 23.04 GCC 13 32 UBSAN",
|
||||||
|
"cppalliance/droneubuntu2304:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32' } + ubsan,
|
||||||
|
"g++-13-multilib",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 23.04 GCC 13 64 UBSAN",
|
||||||
|
"cppalliance/droneubuntu2304:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '64' } + ubsan,
|
||||||
|
"g++-13-multilib",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 24.04 GCC 14 UBSAN",
|
||||||
|
"cppalliance/droneubuntu2404:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '03,11,14,17,20,2b' } + ubsan,
|
||||||
|
"g++-14-multilib",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 24.04 GCC 14 ASAN",
|
||||||
|
"cppalliance/droneubuntu2404:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '03,11,14,17,20,2b' } + asan,
|
||||||
|
"g++-14-multilib",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 16.04 Clang 3.5",
|
||||||
|
"cppalliance/droneubuntu1604:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-3.5', CXXSTD: '03,11' },
|
||||||
|
"clang-3.5",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 16.04 Clang 3.6",
|
||||||
|
"cppalliance/droneubuntu1604:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-3.6', CXXSTD: '03,11,14' },
|
||||||
|
"clang-3.6",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 16.04 Clang 3.7",
|
||||||
|
"cppalliance/droneubuntu1604:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-3.7', CXXSTD: '03,11,14' },
|
||||||
|
"clang-3.7",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 16.04 Clang 3.8",
|
||||||
|
"cppalliance/droneubuntu1604:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-3.8', CXXSTD: '03,11,14' },
|
||||||
|
"clang-3.8",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 18.04 Clang 3.9",
|
||||||
|
"cppalliance/droneubuntu1804:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-3.9', CXXSTD: '03,11,14' },
|
||||||
|
"clang-3.9",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 18.04 Clang 4.0",
|
||||||
|
"cppalliance/droneubuntu1804:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-4.0', CXXSTD: '03,11,14' },
|
||||||
|
"clang-4.0",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 18.04 Clang 5.0",
|
||||||
|
"cppalliance/droneubuntu1804:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-5.0', CXXSTD: '03,11,14' },
|
||||||
|
"clang-5.0",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 Clang 6.0",
|
||||||
|
"cppalliance/droneubuntu2004:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-6.0', CXXSTD: '03,11,14,17' },
|
||||||
|
"clang-6.0",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 Clang 7",
|
||||||
|
"cppalliance/droneubuntu2004:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-7', CXXSTD: '03,11,14,17' },
|
||||||
|
"clang-7",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 Clang 8",
|
||||||
|
"cppalliance/droneubuntu2004:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-8', CXXSTD: '03,11,14,17' },
|
||||||
|
"clang-8",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 Clang 9",
|
||||||
|
"cppalliance/droneubuntu2004:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-9', CXXSTD: '03,11,14,17,2a' },
|
||||||
|
"clang-9",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 Clang 10",
|
||||||
|
"cppalliance/droneubuntu2004:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-10', CXXSTD: '03,11,14,17,2a' },
|
||||||
|
"clang-10",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 Clang 11",
|
||||||
|
"cppalliance/droneubuntu2004:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-11', CXXSTD: '03,11,14,17,2a' },
|
||||||
|
"clang-11",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 Clang 12",
|
||||||
|
"cppalliance/droneubuntu2004:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-12', CXXSTD: '03,11,14,17,20' },
|
||||||
|
"clang-12",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 22.04 Clang 13",
|
||||||
|
"cppalliance/droneubuntu2204:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-13', CXXSTD: '03,11,14,17,20,2b' },
|
||||||
|
"clang-13",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 22.04 Clang 14",
|
||||||
|
"cppalliance/droneubuntu2204:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20,2b' },
|
||||||
|
"clang-14",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 22.04 Clang 15",
|
||||||
|
"cppalliance/droneubuntu2204:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-15', CXXSTD: '03,11,14,17,20,2b' },
|
||||||
|
"clang-15",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 23.04 Clang 16",
|
||||||
|
"cppalliance/droneubuntu2304:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-16', CXXSTD: '03,11,14,17,20,2b' },
|
||||||
|
"clang-16",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 23.10 Clang 17 UBSAN",
|
||||||
|
"cppalliance/droneubuntu2310:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '03,11,14,17,20,2b' } + ubsan,
|
||||||
|
"clang-17",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 23.10 Clang 17 ASAN",
|
||||||
|
"cppalliance/droneubuntu2310:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '03,11,14,17,20,2b' } + asan,
|
||||||
|
"clang-17",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 24.04 Clang 18 UBSAN",
|
||||||
|
"cppalliance/droneubuntu2404:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '03,11,14,17,20,2b' } + ubsan,
|
||||||
|
"clang-18",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 24.04 Clang 18 ASAN",
|
||||||
|
"cppalliance/droneubuntu2404:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '03,11,14,17,20,2b' } + asan,
|
||||||
|
"clang-18",
|
||||||
|
),
|
||||||
|
|
||||||
|
macos_pipeline(
|
||||||
|
"MacOS 10.15 Xcode 12.2 UBSAN",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,1z' } + ubsan,
|
||||||
|
),
|
||||||
|
|
||||||
|
macos_pipeline(
|
||||||
|
"MacOS 10.15 Xcode 12.2 ASAN",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,1z' } + asan,
|
||||||
|
),
|
||||||
|
|
||||||
|
macos_pipeline(
|
||||||
|
"MacOS 12.4 Xcode 13.4.1 UBSAN",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' } + ubsan,
|
||||||
|
xcode_version = "13.4.1", osx_version = "monterey", arch = "arm64",
|
||||||
|
),
|
||||||
|
|
||||||
|
macos_pipeline(
|
||||||
|
"MacOS 12.4 Xcode 13.4.1 ASAN",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' } + asan,
|
||||||
|
xcode_version = "13.4.1", osx_version = "monterey", arch = "arm64",
|
||||||
|
),
|
||||||
|
|
||||||
|
windows_pipeline(
|
||||||
|
"Windows VS2015 msvc-14.0",
|
||||||
|
"cppalliance/dronevs2015",
|
||||||
|
{ TOOLSET: 'msvc-14.0', CXXSTD: '14,latest', B2_DONT_EMBED_MANIFEST: '1' },
|
||||||
|
),
|
||||||
|
|
||||||
|
windows_pipeline(
|
||||||
|
"Windows VS2017 msvc-14.1",
|
||||||
|
"cppalliance/dronevs2017",
|
||||||
|
{ TOOLSET: 'msvc-14.1', CXXSTD: '14,17,latest' },
|
||||||
|
),
|
||||||
|
|
||||||
|
windows_pipeline(
|
||||||
|
"Windows VS2019 msvc-14.2",
|
||||||
|
"cppalliance/dronevs2019",
|
||||||
|
{ TOOLSET: 'msvc-14.2', CXXSTD: '14,17,20,latest' },
|
||||||
|
),
|
||||||
|
|
||||||
|
windows_pipeline(
|
||||||
|
"Windows VS2022 msvc-14.3",
|
||||||
|
"cppalliance/dronevs2022:1",
|
||||||
|
{ TOOLSET: 'msvc-14.3', CXXSTD: '14,17,20,latest' },
|
||||||
|
),
|
||||||
|
]
|
23
.drone/drone.bat
Normal file
23
.drone/drone.bat
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
@REM Copyright 2022 Peter Dimov
|
||||||
|
@REM Distributed under the Boost Software License, Version 1.0.
|
||||||
|
@REM https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
@ECHO ON
|
||||||
|
|
||||||
|
set LIBRARY=%1
|
||||||
|
set DRONE_BUILD_DIR=%CD%
|
||||||
|
|
||||||
|
set BOOST_BRANCH=develop
|
||||||
|
if "%DRONE_BRANCH%" == "master" set BOOST_BRANCH=master
|
||||||
|
cd ..
|
||||||
|
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||||
|
cd boost-root
|
||||||
|
git submodule update --init tools/boostdep
|
||||||
|
xcopy /s /e /q %DRONE_BUILD_DIR% libs\%LIBRARY%\
|
||||||
|
python tools/boostdep/depinst/depinst.py %LIBRARY%
|
||||||
|
cmd /c bootstrap
|
||||||
|
b2 -d0 headers
|
||||||
|
|
||||||
|
if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
|
||||||
|
if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD%
|
||||||
|
b2 -j3 libs/%LIBRARY%/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release embed-manifest-via=linker
|
25
.drone/drone.sh
Executable file
25
.drone/drone.sh
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright 2022 Peter Dimov
|
||||||
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
|
# https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
export PATH=~/.local/bin:/usr/local/bin:$PATH
|
||||||
|
|
||||||
|
DRONE_BUILD_DIR=$(pwd)
|
||||||
|
|
||||||
|
BOOST_BRANCH=develop
|
||||||
|
if [ "$DRONE_BRANCH" = "master" ]; then BOOST_BRANCH=master; fi
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||||
|
cd boost-root
|
||||||
|
git submodule update --init tools/boostdep
|
||||||
|
cp -r $DRONE_BUILD_DIR/* libs/$LIBRARY
|
||||||
|
python tools/boostdep/depinst/depinst.py $LIBRARY
|
||||||
|
./bootstrap.sh
|
||||||
|
./b2 -d0 headers
|
||||||
|
|
||||||
|
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
|
||||||
|
./b2 -j3 libs/$LIBRARY/test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${ADDRMD:+address-model=$ADDRMD} ${UBSAN:+undefined-sanitizer=norecover debug-symbols=on} ${ASAN:+address-sanitizer=norecover debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}
|
541
.github/workflows/ci.yml
vendored
541
.github/workflows/ci.yml
vendored
@@ -17,90 +17,98 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- toolset: gcc-4.7
|
|
||||||
cxxstd: "03,11"
|
|
||||||
os: ubuntu-16.04
|
|
||||||
install: g++-4.7
|
|
||||||
- toolset: gcc-4.8
|
- toolset: gcc-4.8
|
||||||
cxxstd: "03,11"
|
cxxstd: "03,11"
|
||||||
os: ubuntu-16.04
|
os: ubuntu-latest
|
||||||
install: g++-4.8
|
container: ubuntu:18.04
|
||||||
- toolset: gcc-4.9
|
install: g++-4.8-multilib
|
||||||
cxxstd: "03,11"
|
address-model: 32,64
|
||||||
os: ubuntu-16.04
|
|
||||||
install: g++-4.9
|
|
||||||
- toolset: gcc-5
|
- toolset: gcc-5
|
||||||
cxxstd: "03,11,14,1z"
|
cxxstd: "03,11,14,1z"
|
||||||
os: ubuntu-16.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:18.04
|
||||||
|
install: g++-5-multilib
|
||||||
|
address-model: 32,64
|
||||||
- toolset: gcc-6
|
- toolset: gcc-6
|
||||||
cxxstd: "03,11,14,1z"
|
cxxstd: "03,11,14,1z"
|
||||||
os: ubuntu-16.04
|
os: ubuntu-latest
|
||||||
install: g++-6
|
container: ubuntu:18.04
|
||||||
|
install: g++-6-multilib
|
||||||
|
address-model: 32,64
|
||||||
- toolset: gcc-7
|
- toolset: gcc-7
|
||||||
cxxstd: "03,11,14,17"
|
cxxstd: "03,11,14,17"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:18.04
|
||||||
|
install: g++-7-multilib
|
||||||
|
address-model: 32,64
|
||||||
- toolset: gcc-8
|
- toolset: gcc-8
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "03,11,14,17,2a"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-20.04
|
||||||
install: g++-8
|
install: g++-8-multilib
|
||||||
|
address-model: 32,64
|
||||||
- toolset: gcc-9
|
- toolset: gcc-9
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "03,11,14,17,2a"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-20.04
|
||||||
|
install: g++-9-multilib
|
||||||
|
address-model: 32,64
|
||||||
- toolset: gcc-10
|
- toolset: gcc-10
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "03,11,14,17,2a"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-20.04
|
||||||
|
install: g++-10-multilib
|
||||||
|
address-model: 32,64
|
||||||
- toolset: gcc-11
|
- toolset: gcc-11
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "03,11,14,17,20"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-22.04
|
||||||
install: g++-11
|
install: g++-11-multilib
|
||||||
- toolset: clang
|
address-model: 32,64
|
||||||
compiler: clang++-3.5
|
- toolset: gcc-12
|
||||||
cxxstd: "03,11"
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
os: ubuntu-16.04
|
os: ubuntu-22.04
|
||||||
install: clang-3.5
|
install: g++-12-multilib
|
||||||
- toolset: clang
|
address-model: 32,64
|
||||||
compiler: clang++-3.6
|
- toolset: gcc-13
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
os: ubuntu-16.04
|
os: ubuntu-latest
|
||||||
install: clang-3.6
|
container: ubuntu:23.04
|
||||||
- toolset: clang
|
install: g++-13-multilib
|
||||||
compiler: clang++-3.7
|
address-model: 32,64
|
||||||
cxxstd: "03,11,14"
|
- toolset: gcc-14
|
||||||
os: ubuntu-16.04
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
install: clang-3.7
|
os: ubuntu-latest
|
||||||
- toolset: clang
|
container: ubuntu:24.04
|
||||||
compiler: clang++-3.8
|
install: g++-14-multilib
|
||||||
cxxstd: "03,11,14"
|
address-model: 32,64
|
||||||
os: ubuntu-16.04
|
|
||||||
install: clang-3.8
|
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-3.9
|
compiler: clang++-3.9
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "03,11,14"
|
||||||
os: ubuntu-16.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:18.04
|
||||||
install: clang-3.9
|
install: clang-3.9
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-4.0
|
compiler: clang++-4.0
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "03,11,14"
|
||||||
os: ubuntu-16.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:18.04
|
||||||
install: clang-4.0
|
install: clang-4.0
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-5.0
|
compiler: clang++-5.0
|
||||||
cxxstd: "03,11,14,1z"
|
cxxstd: "03,11,14,1z"
|
||||||
os: ubuntu-16.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:18.04
|
||||||
install: clang-5.0
|
install: clang-5.0
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-6.0
|
compiler: clang++-6.0
|
||||||
cxxstd: "03,11,14,17"
|
cxxstd: "03,11,14,17"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-20.04
|
||||||
install: clang-6.0
|
install: clang-6.0
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-7
|
compiler: clang++-7
|
||||||
cxxstd: "03,11,14,17"
|
cxxstd: "03,11,14,17"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-20.04
|
||||||
install: clang-7
|
install: clang-7
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-8
|
compiler: clang++-8
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "03,11,14,17"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
install: clang-8
|
install: clang-8
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
@@ -118,20 +126,79 @@ jobs:
|
|||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-12
|
compiler: clang++-12
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "03,11,14,17,20"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
cxxstd: "03,11,14,17,2a"
|
compiler: clang++-13
|
||||||
os: macos-10.15
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
|
container: ubuntu:22.04
|
||||||
|
os: ubuntu-latest
|
||||||
|
install: clang-13
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-14
|
||||||
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
|
container: ubuntu:22.04
|
||||||
|
os: ubuntu-latest
|
||||||
|
install: clang-14
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-15
|
||||||
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
|
container: ubuntu:22.04
|
||||||
|
os: ubuntu-latest
|
||||||
|
install: clang-15
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-16
|
||||||
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
|
container: ubuntu:23.04
|
||||||
|
os: ubuntu-latest
|
||||||
|
install: clang-16
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-17
|
||||||
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
|
container: ubuntu:23.10
|
||||||
|
os: ubuntu-latest
|
||||||
|
install: clang-17
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-18
|
||||||
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
|
container: ubuntu:24.04
|
||||||
|
os: ubuntu-latest
|
||||||
|
install: clang-18
|
||||||
|
- toolset: clang
|
||||||
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
|
os: macos-12
|
||||||
|
- toolset: clang
|
||||||
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
|
os: macos-13
|
||||||
|
- toolset: clang
|
||||||
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
|
os: macos-14
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
|
container: ${{matrix.container}}
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: Enable Node 16
|
||||||
|
run: |
|
||||||
|
echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup container environment
|
||||||
|
if: matrix.container
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get -y install sudo python3 git g++
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
if: matrix.install
|
if: matrix.install
|
||||||
run: sudo apt install ${{matrix.install}}
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get -y install ${{matrix.install}}
|
||||||
|
|
||||||
- name: Setup Boost
|
- name: Setup Boost
|
||||||
run: |
|
run: |
|
||||||
@@ -151,7 +218,7 @@ jobs:
|
|||||||
cd boost-root
|
cd boost-root
|
||||||
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
||||||
git submodule update --init tools/boostdep
|
git submodule update --init tools/boostdep
|
||||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
|
python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
|
||||||
./bootstrap.sh
|
./bootstrap.sh
|
||||||
./b2 -d0 headers
|
./b2 -d0 headers
|
||||||
|
|
||||||
@@ -163,21 +230,29 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
cd ../boost-root
|
cd ../boost-root
|
||||||
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release
|
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} ${ADDRMD:+address-model=$ADDRMD} variant=debug,release
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- toolset: msvc-14.1
|
- toolset: msvc-14.0
|
||||||
cxxstd: "14,17,latest"
|
cxxstd: 14,latest
|
||||||
addrmd: 32,64
|
|
||||||
os: windows-2016
|
|
||||||
- toolset: msvc-14.2
|
|
||||||
cxxstd: "14,17,latest"
|
|
||||||
addrmd: 32,64
|
addrmd: 32,64
|
||||||
os: windows-2019
|
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
|
||||||
|
os: windows-2022
|
||||||
|
- toolset: clang-win
|
||||||
|
cxxstd: "14,17,20,latest"
|
||||||
|
addrmd: 32,64
|
||||||
|
os: windows-2022
|
||||||
- toolset: gcc
|
- toolset: gcc
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "03,11,14,17,2a"
|
||||||
addrmd: 64
|
addrmd: 64
|
||||||
@@ -186,7 +261,7 @@ jobs:
|
|||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Boost
|
- name: Setup Boost
|
||||||
shell: cmd
|
shell: cmd
|
||||||
@@ -214,4 +289,346 @@ jobs:
|
|||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
cd ../boost-root
|
cd ../boost-root
|
||||||
b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release
|
b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release embed-manifest-via=linker
|
||||||
|
|
||||||
|
posix-cmake-subdir:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
- os: ubuntu-22.04
|
||||||
|
- os: macos-12
|
||||||
|
- os: macos-13
|
||||||
|
- os: macos-14
|
||||||
|
|
||||||
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install packages
|
||||||
|
if: matrix.install
|
||||||
|
run: sudo apt-get -y install ${{matrix.install}}
|
||||||
|
|
||||||
|
- name: Setup Boost
|
||||||
|
run: |
|
||||||
|
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
|
||||||
|
LIBRARY=${GITHUB_REPOSITORY#*/}
|
||||||
|
echo LIBRARY: $LIBRARY
|
||||||
|
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
|
||||||
|
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
|
||||||
|
echo GITHUB_REF: $GITHUB_REF
|
||||||
|
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
|
||||||
|
REF=${REF#refs/heads/}
|
||||||
|
echo REF: $REF
|
||||||
|
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
|
||||||
|
echo BOOST_BRANCH: $BOOST_BRANCH
|
||||||
|
cd ..
|
||||||
|
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||||
|
cd boost-root
|
||||||
|
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
||||||
|
git submodule update --init tools/boostdep
|
||||||
|
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
|
||||||
|
|
||||||
|
- name: Use library with add_subdirectory
|
||||||
|
run: |
|
||||||
|
cd ../boost-root/libs/$LIBRARY/test/cmake_subdir_test
|
||||||
|
mkdir __build__ && cd __build__
|
||||||
|
cmake ..
|
||||||
|
cmake --build .
|
||||||
|
ctest --output-on-failure --no-tests=error
|
||||||
|
|
||||||
|
posix-cmake-install:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
- os: ubuntu-22.04
|
||||||
|
- os: macos-12
|
||||||
|
- os: macos-13
|
||||||
|
- os: macos-14
|
||||||
|
|
||||||
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install packages
|
||||||
|
if: matrix.install
|
||||||
|
run: sudo apt-get -y install ${{matrix.install}}
|
||||||
|
|
||||||
|
- name: Setup Boost
|
||||||
|
run: |
|
||||||
|
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
|
||||||
|
LIBRARY=${GITHUB_REPOSITORY#*/}
|
||||||
|
echo LIBRARY: $LIBRARY
|
||||||
|
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
|
||||||
|
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
|
||||||
|
echo GITHUB_REF: $GITHUB_REF
|
||||||
|
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
|
||||||
|
REF=${REF#refs/heads/}
|
||||||
|
echo REF: $REF
|
||||||
|
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
|
||||||
|
echo BOOST_BRANCH: $BOOST_BRANCH
|
||||||
|
cd ..
|
||||||
|
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||||
|
cd boost-root
|
||||||
|
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
||||||
|
git submodule update --init tools/boostdep
|
||||||
|
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
|
||||||
|
|
||||||
|
- name: Configure
|
||||||
|
run: |
|
||||||
|
cd ../boost-root
|
||||||
|
mkdir __build__ && cd __build__
|
||||||
|
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DCMAKE_INSTALL_PREFIX=~/.local ..
|
||||||
|
|
||||||
|
- name: Install
|
||||||
|
run: |
|
||||||
|
cd ../boost-root/__build__
|
||||||
|
cmake --build . --target install
|
||||||
|
|
||||||
|
- name: Use the installed library
|
||||||
|
run: |
|
||||||
|
cd ../boost-root/libs/$LIBRARY/test/cmake_install_test && mkdir __build__ && cd __build__
|
||||||
|
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
|
||||||
|
cmake --build .
|
||||||
|
ctest --output-on-failure --no-tests=error
|
||||||
|
|
||||||
|
posix-cmake-test:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-20.04
|
||||||
|
- os: ubuntu-22.04
|
||||||
|
- os: macos-12
|
||||||
|
- os: macos-13
|
||||||
|
- os: macos-14
|
||||||
|
|
||||||
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install packages
|
||||||
|
if: matrix.install
|
||||||
|
run: sudo apt-get -y install ${{matrix.install}}
|
||||||
|
|
||||||
|
- name: Setup Boost
|
||||||
|
run: |
|
||||||
|
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
|
||||||
|
LIBRARY=${GITHUB_REPOSITORY#*/}
|
||||||
|
echo LIBRARY: $LIBRARY
|
||||||
|
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
|
||||||
|
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
|
||||||
|
echo GITHUB_REF: $GITHUB_REF
|
||||||
|
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
|
||||||
|
REF=${REF#refs/heads/}
|
||||||
|
echo REF: $REF
|
||||||
|
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
|
||||||
|
echo BOOST_BRANCH: $BOOST_BRANCH
|
||||||
|
cd ..
|
||||||
|
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||||
|
cd boost-root
|
||||||
|
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
||||||
|
git submodule update --init tools/boostdep
|
||||||
|
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
|
||||||
|
|
||||||
|
- name: Configure
|
||||||
|
run: |
|
||||||
|
cd ../boost-root
|
||||||
|
mkdir __build__ && cd __build__
|
||||||
|
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON ..
|
||||||
|
|
||||||
|
- name: Build tests
|
||||||
|
run: |
|
||||||
|
cd ../boost-root/__build__
|
||||||
|
cmake --build . --target tests
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
cd ../boost-root/__build__
|
||||||
|
ctest --output-on-failure --no-tests=error
|
||||||
|
|
||||||
|
windows-cmake-subdir:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: windows-2019
|
||||||
|
- os: windows-2022
|
||||||
|
|
||||||
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Boost
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
|
||||||
|
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
|
||||||
|
echo LIBRARY: %LIBRARY%
|
||||||
|
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
|
||||||
|
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
|
||||||
|
echo GITHUB_REF: %GITHUB_REF%
|
||||||
|
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
|
||||||
|
set BOOST_BRANCH=develop
|
||||||
|
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
|
||||||
|
echo BOOST_BRANCH: %BOOST_BRANCH%
|
||||||
|
cd ..
|
||||||
|
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||||
|
cd boost-root
|
||||||
|
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
|
||||||
|
git submodule update --init tools/boostdep
|
||||||
|
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
|
||||||
|
|
||||||
|
- name: Use library with add_subdirectory (Debug)
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test
|
||||||
|
mkdir __build__ && cd __build__
|
||||||
|
cmake ..
|
||||||
|
cmake --build . --config Debug
|
||||||
|
ctest --output-on-failure --no-tests=error -C Debug
|
||||||
|
|
||||||
|
- name: Use library with add_subdirectory (Release)
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test/__build__
|
||||||
|
cmake --build . --config Release
|
||||||
|
ctest --output-on-failure --no-tests=error -C Release
|
||||||
|
|
||||||
|
windows-cmake-install:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: windows-2019
|
||||||
|
- os: windows-2022
|
||||||
|
|
||||||
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Boost
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
|
||||||
|
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
|
||||||
|
echo LIBRARY: %LIBRARY%
|
||||||
|
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
|
||||||
|
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
|
||||||
|
echo GITHUB_REF: %GITHUB_REF%
|
||||||
|
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
|
||||||
|
set BOOST_BRANCH=develop
|
||||||
|
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
|
||||||
|
echo BOOST_BRANCH: %BOOST_BRANCH%
|
||||||
|
cd ..
|
||||||
|
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||||
|
cd boost-root
|
||||||
|
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
|
||||||
|
git submodule update --init tools/boostdep
|
||||||
|
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
|
||||||
|
|
||||||
|
- name: Configure
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
cd ../boost-root
|
||||||
|
mkdir __build__ && cd __build__
|
||||||
|
cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
|
||||||
|
|
||||||
|
- name: Install (Debug)
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
cd ../boost-root/__build__
|
||||||
|
cmake --build . --target install --config Debug
|
||||||
|
|
||||||
|
- name: Install (Release)
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
cd ../boost-root/__build__
|
||||||
|
cmake --build . --target install --config Release
|
||||||
|
|
||||||
|
- name: Use the installed library (Debug)
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test && mkdir __build__ && cd __build__
|
||||||
|
cmake -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
|
||||||
|
cmake --build . --config Debug
|
||||||
|
ctest --output-on-failure --no-tests=error -C Debug
|
||||||
|
|
||||||
|
- name: Use the installed library (Release)
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test/__build__
|
||||||
|
cmake --build . --config Release
|
||||||
|
ctest --output-on-failure --no-tests=error -C Release
|
||||||
|
|
||||||
|
windows-cmake-test:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: windows-2019
|
||||||
|
- os: windows-2022
|
||||||
|
|
||||||
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Boost
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
|
||||||
|
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
|
||||||
|
echo LIBRARY: %LIBRARY%
|
||||||
|
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
|
||||||
|
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
|
||||||
|
echo GITHUB_REF: %GITHUB_REF%
|
||||||
|
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
|
||||||
|
set BOOST_BRANCH=develop
|
||||||
|
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
|
||||||
|
echo BOOST_BRANCH: %BOOST_BRANCH%
|
||||||
|
cd ..
|
||||||
|
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||||
|
cd boost-root
|
||||||
|
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
|
||||||
|
git submodule update --init tools/boostdep
|
||||||
|
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
|
||||||
|
|
||||||
|
- name: Configure
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
cd ../boost-root
|
||||||
|
mkdir __build__ && cd __build__
|
||||||
|
cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DBUILD_TESTING=ON ..
|
||||||
|
|
||||||
|
- name: Build tests (Debug)
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
cd ../boost-root/__build__
|
||||||
|
cmake --build . --target tests --config Debug
|
||||||
|
|
||||||
|
- name: Run tests (Debug)
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
cd ../boost-root/__build__
|
||||||
|
ctest --output-on-failure --no-tests=error -C Debug
|
||||||
|
|
||||||
|
- name: Build tests (Release)
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
cd ../boost-root/__build__
|
||||||
|
cmake --build . --target tests --config Release
|
||||||
|
|
||||||
|
- name: Run tests (Release)
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
cd ../boost-root/__build__
|
||||||
|
ctest --output-on-failure --no-tests=error -C Release
|
||||||
|
43
appveyor.yml
43
appveyor.yml
@@ -15,23 +15,28 @@ branches:
|
|||||||
environment:
|
environment:
|
||||||
matrix:
|
matrix:
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0
|
TOOLSET: msvc-9.0
|
||||||
ADDRMD: 32
|
ADDRMD: 32
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
TOOLSET: msvc-12.0,msvc-14.0
|
TOOLSET: msvc-10.0
|
||||||
|
ADDRMD: 32
|
||||||
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
|
TOOLSET: msvc-11.0
|
||||||
|
ADDRMD: 32
|
||||||
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
|
TOOLSET: msvc-12.0
|
||||||
|
ADDRMD: 32,64
|
||||||
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
|
TOOLSET: msvc-14.0
|
||||||
ADDRMD: 32,64
|
ADDRMD: 32,64
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||||
TOOLSET: msvc-14.1
|
TOOLSET: msvc-14.1
|
||||||
CXXSTD: 14,17
|
CXXSTD: 14,17
|
||||||
ADDRMD: 32,64
|
ADDRMD: 32,64
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
|
||||||
TOOLSET: clang-win
|
|
||||||
CXXSTD: 14,17
|
|
||||||
ADDRMD: 64
|
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||||
TOOLSET: msvc-14.2
|
TOOLSET: clang-win
|
||||||
CXXSTD: 14,17,latest
|
CXXSTD: 14,17,latest
|
||||||
ADDRMD: 32,64
|
ADDRMD: 64
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
ADDPATH: C:\cygwin\bin;
|
ADDPATH: C:\cygwin\bin;
|
||||||
TOOLSET: gcc
|
TOOLSET: gcc
|
||||||
@@ -55,25 +60,9 @@ install:
|
|||||||
- cd ..
|
- cd ..
|
||||||
- git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
- git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||||
- cd boost-root
|
- cd boost-root
|
||||||
- git submodule init libs/align
|
|
||||||
- git submodule init libs/assert
|
|
||||||
- git submodule init libs/atomic
|
|
||||||
- git submodule init libs/config
|
|
||||||
- git submodule init libs/container_hash
|
|
||||||
- git submodule init libs/core
|
|
||||||
- git submodule init libs/move
|
|
||||||
- git submodule init libs/predef
|
|
||||||
- git submodule init libs/static_assert
|
|
||||||
- git submodule init libs/throw_exception
|
|
||||||
- git submodule init libs/type_traits
|
|
||||||
- git submodule init libs/detail
|
|
||||||
- git submodule init libs/integer
|
|
||||||
- git submodule init tools/build
|
|
||||||
- git submodule init libs/headers
|
|
||||||
- git submodule init tools/boost_install
|
|
||||||
- git submodule init libs/bind
|
|
||||||
- git submodule update --jobs 3
|
|
||||||
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\smart_ptr\
|
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\smart_ptr\
|
||||||
|
- git submodule update --init tools/boostdep
|
||||||
|
- python tools/boostdep/depinst/depinst.py smart_ptr
|
||||||
- cmd /c bootstrap
|
- cmd /c bootstrap
|
||||||
- b2 -d0 headers
|
- b2 -d0 headers
|
||||||
|
|
||||||
@@ -83,4 +72,4 @@ test_script:
|
|||||||
- PATH=%ADDPATH%%PATH%
|
- PATH=%ADDPATH%%PATH%
|
||||||
- if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
|
- if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
|
||||||
- if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD%
|
- if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD%
|
||||||
- b2 -j3 libs/smart_ptr/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release
|
- b2 -j3 libs/smart_ptr/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release embed-manifest-via=linker
|
||||||
|
@@ -14,6 +14,8 @@ Greg Colvin, Beman Dawes, Peter Dimov, Glen Fernandes
|
|||||||
:idprefix:
|
:idprefix:
|
||||||
:listing-caption: Code Example
|
:listing-caption: Code Example
|
||||||
:docinfo: private-footer
|
:docinfo: private-footer
|
||||||
|
:source-highlighter: rouge
|
||||||
|
:source-language: c++
|
||||||
|
|
||||||
:leveloffset: +1
|
:leveloffset: +1
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
////
|
////
|
||||||
Copyright 2019 Glen Joseph Fernandes (glenjofe@gmail.com)
|
Copyright 2019-2021 Glen Joseph Fernandes (glenjofe@gmail.com)
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
Distributed under the Boost Software License, Version 1.0.
|
||||||
|
|
||||||
@@ -85,6 +85,11 @@ namespace boost {
|
|||||||
template<class T, class A>
|
template<class T, class A>
|
||||||
std::unique_ptr<remove_extent_t<T>[], alloc_noinit_deleter<T, A>>
|
std::unique_ptr<remove_extent_t<T>[], alloc_noinit_deleter<T, A>>
|
||||||
allocate_unique_noinit(const A& a);
|
allocate_unique_noinit(const A& a);
|
||||||
|
|
||||||
|
template<class T, class U, class A>
|
||||||
|
allocator_pointer_t<allocator_rebind_t<A, remove_cv_t<remove_extent_t<T>>>>
|
||||||
|
get_allocator_pointer(const std::unique_ptr<T,
|
||||||
|
alloc_deleter<U, A>>& p) noexcept;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -269,6 +274,18 @@ Returns:: A `std::unique_ptr` to a sequence of `extent_v<T>`
|
|||||||
default-initialized objects of type `remove_extent_t<T>`.
|
default-initialized objects of type `remove_extent_t<T>`.
|
||||||
Example:: `auto p = allocate_unique_noinit<double[1024]>(a);`
|
Example:: `auto p = allocate_unique_noinit<double[1024]>(a);`
|
||||||
|
|
||||||
|
```
|
||||||
|
template<class T, class U, class A>
|
||||||
|
allocator_pointer_t<allocator_rebind_t<A, remove_cv_t<remove_extent_t<T>>>>
|
||||||
|
get_allocator_pointer(const std::unique_ptr<T,
|
||||||
|
alloc_deleter<U, A>>& p) noexcept;
|
||||||
|
```
|
||||||
|
[none]
|
||||||
|
* {blank}
|
||||||
|
+
|
||||||
|
Returns:: The allocator pointer to the allocation.
|
||||||
|
Example:: `auto r = boost::get_allocator_ptr(p);`
|
||||||
|
|
||||||
## Deleter
|
## Deleter
|
||||||
|
|
||||||
Class template `alloc_deleter` is the deleter used by the `allocate_unique`
|
Class template `alloc_deleter` is the deleter used by the `allocate_unique`
|
||||||
|
@@ -13,6 +13,10 @@ http://www.boost.org/LICENSE_1_0.txt
|
|||||||
:toc-title:
|
:toc-title:
|
||||||
:idprefix: changelog_
|
:idprefix: changelog_
|
||||||
|
|
||||||
|
## Changes in 1.79.0
|
||||||
|
|
||||||
|
* Added `get_allocator_pointer`
|
||||||
|
|
||||||
## Changes in 1.74.0
|
## Changes in 1.74.0
|
||||||
|
|
||||||
* Added `owner_equals` to `shared_ptr`, `weak_ptr`, `local_shared_ptr`
|
* Added `owner_equals` to `shared_ptr`, `weak_ptr`, `local_shared_ptr`
|
||||||
|
@@ -30,8 +30,8 @@ requests from users.
|
|||||||
|
|
||||||
This library also provides additional overloads of `make_unique` for
|
This library also provides additional overloads of `make_unique` for
|
||||||
default-initialization, when users do not need or want to incur the expense
|
default-initialization, when users do not need or want to incur the expense
|
||||||
of value-initialization. The {cpp} standard does not yet provide this
|
of value-initialization. The {cpp}20 standard now provides this feature with
|
||||||
feature with `std::make_unique`.
|
`std::make_unique_for_overwrite`.
|
||||||
|
|
||||||
## Synopsis
|
## Synopsis
|
||||||
|
|
||||||
|
@@ -8,6 +8,7 @@ Distributed under the Boost Software License, Version 1.0.
|
|||||||
#ifndef BOOST_SMART_PTR_ALLOCATE_LOCAL_SHARED_ARRAY_HPP
|
#ifndef BOOST_SMART_PTR_ALLOCATE_LOCAL_SHARED_ARRAY_HPP
|
||||||
#define BOOST_SMART_PTR_ALLOCATE_LOCAL_SHARED_ARRAY_HPP
|
#define BOOST_SMART_PTR_ALLOCATE_LOCAL_SHARED_ARRAY_HPP
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/smart_ptr/allocate_shared_array.hpp>
|
#include <boost/smart_ptr/allocate_shared_array.hpp>
|
||||||
#include <boost/smart_ptr/local_shared_ptr.hpp>
|
#include <boost/smart_ptr/local_shared_ptr.hpp>
|
||||||
|
|
||||||
|
@@ -8,6 +8,7 @@ Distributed under the Boost Software License, Version 1.0.
|
|||||||
#ifndef BOOST_SMART_PTR_ALLOCATE_SHARED_ARRAY_HPP
|
#ifndef BOOST_SMART_PTR_ALLOCATE_SHARED_ARRAY_HPP
|
||||||
#define BOOST_SMART_PTR_ALLOCATE_SHARED_ARRAY_HPP
|
#define BOOST_SMART_PTR_ALLOCATE_SHARED_ARRAY_HPP
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/core/allocator_access.hpp>
|
#include <boost/core/allocator_access.hpp>
|
||||||
#include <boost/core/alloc_construct.hpp>
|
#include <boost/core/alloc_construct.hpp>
|
||||||
#include <boost/core/first_scalar.hpp>
|
#include <boost/core/first_scalar.hpp>
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2019 Glen Joseph Fernandes
|
Copyright 2019-2021 Glen Joseph Fernandes
|
||||||
(glenjofe@gmail.com)
|
(glenjofe@gmail.com)
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
Distributed under the Boost Software License, Version 1.0.
|
||||||
@@ -8,6 +8,7 @@ Distributed under the Boost Software License, Version 1.0.
|
|||||||
#ifndef BOOST_SMART_PTR_ALLOCATE_UNIQUE_HPP
|
#ifndef BOOST_SMART_PTR_ALLOCATE_UNIQUE_HPP
|
||||||
#define BOOST_SMART_PTR_ALLOCATE_UNIQUE_HPP
|
#define BOOST_SMART_PTR_ALLOCATE_UNIQUE_HPP
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
|
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
|
||||||
#include <boost/core/allocator_access.hpp>
|
#include <boost/core/allocator_access.hpp>
|
||||||
@@ -477,6 +478,15 @@ allocate_unique(const A& alloc,
|
|||||||
return c.release();
|
return c.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class T, class U, class A>
|
||||||
|
inline typename allocator_pointer<typename allocator_rebind<A,
|
||||||
|
typename detail::sp_alloc_value<T>::type>::type>::type
|
||||||
|
get_allocator_pointer(const std::unique_ptr<T,
|
||||||
|
alloc_deleter<U, A> >& p) BOOST_NOEXCEPT
|
||||||
|
{
|
||||||
|
return p.get().ptr();
|
||||||
|
}
|
||||||
|
|
||||||
} /* boost */
|
} /* boost */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/smart_ptr/shared_ptr.hpp>
|
#include <boost/smart_ptr/shared_ptr.hpp>
|
||||||
#include <boost/smart_ptr/detail/spinlock.hpp>
|
#include <boost/smart_ptr/detail/spinlock.hpp>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
23
include/boost/smart_ptr/detail/requires_cxx11.hpp
Normal file
23
include/boost/smart_ptr/detail/requires_cxx11.hpp
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#ifndef BOOST_SMART_PTR_DETAIL_REQUIRES_CXX11_HPP_INCLUDED
|
||||||
|
#define BOOST_SMART_PTR_DETAIL_REQUIRES_CXX11_HPP_INCLUDED
|
||||||
|
|
||||||
|
// Copyright 2023 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/config/pragma_message.hpp>
|
||||||
|
|
||||||
|
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || \
|
||||||
|
defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
|
||||||
|
defined(BOOST_NO_CXX11_DECLTYPE) || \
|
||||||
|
defined(BOOST_NO_CXX11_CONSTEXPR) || \
|
||||||
|
defined(BOOST_NO_CXX11_NOEXCEPT) || \
|
||||||
|
defined(BOOST_NO_CXX11_NULLPTR) || \
|
||||||
|
defined(BOOST_NO_CXX11_SMART_PTR)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE("C++03 support was deprecated in Boost.SmartPtr 1.82 and will be removed in Boost.SmartPtr 1.87.")
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // #ifndef BOOST_SMART_PTR_DETAIL_REQUIRES_CXX11_HPP_INCLUDED
|
@@ -27,7 +27,7 @@
|
|||||||
#include <boost/smart_ptr/detail/sp_counted_impl.hpp>
|
#include <boost/smart_ptr/detail/sp_counted_impl.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_disable_deprecated.hpp>
|
#include <boost/smart_ptr/detail/sp_disable_deprecated.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
||||||
#include <boost/checked_delete.hpp>
|
#include <boost/core/checked_delete.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <boost/core/addressof.hpp>
|
#include <boost/core/addressof.hpp>
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
|
@@ -35,8 +35,6 @@ BOOST_PRAGMA_MESSAGE("Using CodeWarrior/PowerPC sp_counted_base")
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BOOST_SP_OBSOLETE()
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -64,7 +62,11 @@ inline long atomic_decrement( register long * pw )
|
|||||||
|
|
||||||
asm
|
asm
|
||||||
{
|
{
|
||||||
|
#if defined(__PPCZen__) || defined(__PPCe500__) || defined(__PPCe500v2__)
|
||||||
|
msync
|
||||||
|
#else
|
||||||
sync
|
sync
|
||||||
|
#endif
|
||||||
|
|
||||||
loop:
|
loop:
|
||||||
|
|
||||||
|
@@ -137,7 +137,7 @@ public:
|
|||||||
|
|
||||||
long use_count() const // nothrow
|
long use_count() const // nothrow
|
||||||
{
|
{
|
||||||
return atomic_load( &use_count_ );
|
return static_cast<long>( atomic_load( &use_count_ ) );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include <boost/smart_ptr/detail/sp_counted_base.hpp>
|
#include <boost/smart_ptr/detail/sp_counted_base.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
||||||
#include <boost/checked_delete.hpp>
|
#include <boost/core/checked_delete.hpp>
|
||||||
#include <boost/core/addressof.hpp>
|
#include <boost/core/addressof.hpp>
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
|
@@ -17,8 +17,11 @@
|
|||||||
// Defines the BOOST_SP_HAS_GCC_INTRINSICS macro if the __atomic_*
|
// Defines the BOOST_SP_HAS_GCC_INTRINSICS macro if the __atomic_*
|
||||||
// intrinsics are available.
|
// intrinsics are available.
|
||||||
|
|
||||||
|
// Libraries (e.g. Kokkos) sometimes define the __ATOMIC_RELAXED macros,
|
||||||
|
// leading to errors under MSVC (https://github.com/boostorg/smart_ptr/pull/112)
|
||||||
|
|
||||||
#if defined( __ATOMIC_RELAXED ) && defined( __ATOMIC_ACQUIRE ) && defined( __ATOMIC_RELEASE ) && defined( __ATOMIC_ACQ_REL )
|
#if defined( __ATOMIC_RELAXED ) && defined( __ATOMIC_ACQUIRE ) && defined( __ATOMIC_RELEASE ) && defined( __ATOMIC_ACQ_REL ) \
|
||||||
|
&& !( defined(_MSC_VER) && !defined(__clang__) )
|
||||||
|
|
||||||
# define BOOST_SP_HAS_GCC_INTRINSICS
|
# define BOOST_SP_HAS_GCC_INTRINSICS
|
||||||
|
|
||||||
|
@@ -1,51 +1,23 @@
|
|||||||
#ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED
|
#ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED
|
||||||
#define BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED
|
#define BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
// Copyright 2023 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// boost/smart_ptr/detail/sp_thread_pause.hpp
|
|
||||||
//
|
|
||||||
// inline void bost::detail::sp_thread_pause();
|
|
||||||
//
|
|
||||||
// Emits a "pause" instruction.
|
|
||||||
//
|
|
||||||
// Copyright 2008, 2020 Peter Dimov
|
|
||||||
// Distributed under the Boost Software License, Version 1.0
|
|
||||||
// https://www.boost.org/LICENSE_1_0.txt
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
#if defined(_MSC_VER) && _MSC_VER >= 1310 && ( defined(_M_IX86) || defined(_M_X64) ) && !defined(__c2__)
|
#include <boost/core/yield_primitives.hpp>
|
||||||
|
#include <boost/config/header_deprecated.hpp>
|
||||||
|
|
||||||
extern "C" void _mm_pause();
|
BOOST_HEADER_DEPRECATED( "<boost/core/yield_primitives.hpp>" )
|
||||||
|
|
||||||
#define BOOST_SP_PAUSE _mm_pause();
|
|
||||||
|
|
||||||
#elif defined(__GNUC__) && ( defined(__i386__) || defined(__x86_64__) )
|
|
||||||
|
|
||||||
#define BOOST_SP_PAUSE __asm__ __volatile__( "rep; nop" : : : "memory" );
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define BOOST_SP_PAUSE
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
|
||||||
inline void sp_thread_pause()
|
using boost::core::sp_thread_pause;
|
||||||
{
|
|
||||||
BOOST_SP_PAUSE
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#undef BOOST_SP_PAUSE
|
|
||||||
|
|
||||||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED
|
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED
|
||||||
|
@@ -1,104 +1,23 @@
|
|||||||
#ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_SLEEP_HPP_INCLUDED
|
#ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_SLEEP_HPP_INCLUDED
|
||||||
#define BOOST_SMART_PTR_DETAIL_SP_THREAD_SLEEP_HPP_INCLUDED
|
#define BOOST_SMART_PTR_DETAIL_SP_THREAD_SLEEP_HPP_INCLUDED
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
// Copyright 2023 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// boost/smart_ptr/detail/sp_thread_sleep.hpp
|
|
||||||
//
|
|
||||||
// inline void bost::detail::sp_thread_sleep();
|
|
||||||
//
|
|
||||||
// Cease execution for a while to yield to other threads,
|
|
||||||
// as if by calling nanosleep() with an appropriate interval.
|
|
||||||
//
|
|
||||||
// Copyright 2008, 2020 Peter Dimov
|
|
||||||
// Distributed under the Boost Software License, Version 1.0
|
|
||||||
// https://www.boost.org/LICENSE_1_0.txt
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/core/yield_primitives.hpp>
|
||||||
#include <boost/config/pragma_message.hpp>
|
#include <boost/config/header_deprecated.hpp>
|
||||||
|
|
||||||
#if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
|
BOOST_HEADER_DEPRECATED( "<boost/core/yield_primitives.hpp>" )
|
||||||
|
|
||||||
#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
|
|
||||||
BOOST_PRAGMA_MESSAGE("Using Sleep(1) in sp_thread_sleep")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <boost/smart_ptr/detail/sp_win32_sleep.hpp>
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
|
||||||
inline void sp_thread_sleep()
|
using boost::core::sp_thread_sleep;
|
||||||
{
|
|
||||||
Sleep( 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#elif defined(BOOST_HAS_NANOSLEEP)
|
|
||||||
|
|
||||||
#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
|
|
||||||
BOOST_PRAGMA_MESSAGE("Using nanosleep() in sp_thread_sleep")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
inline void sp_thread_sleep()
|
|
||||||
{
|
|
||||||
// g++ -Wextra warns on {} or {0}
|
|
||||||
struct timespec rqtp = { 0, 0 };
|
|
||||||
|
|
||||||
// POSIX says that timespec has tv_sec and tv_nsec
|
|
||||||
// But it doesn't guarantee order or placement
|
|
||||||
|
|
||||||
rqtp.tv_sec = 0;
|
|
||||||
rqtp.tv_nsec = 1000;
|
|
||||||
|
|
||||||
nanosleep( &rqtp, 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
|
|
||||||
BOOST_PRAGMA_MESSAGE("Using sp_thread_yield() in sp_thread_sleep")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <boost/smart_ptr/detail/sp_thread_yield.hpp>
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
inline void sp_thread_sleep()
|
|
||||||
{
|
|
||||||
sp_thread_yield();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_SLEEP_HPP_INCLUDED
|
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_SLEEP_HPP_INCLUDED
|
||||||
|
@@ -1,100 +1,23 @@
|
|||||||
#ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_YIELD_HPP_INCLUDED
|
#ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_YIELD_HPP_INCLUDED
|
||||||
#define BOOST_SMART_PTR_DETAIL_SP_THREAD_YIELD_HPP_INCLUDED
|
#define BOOST_SMART_PTR_DETAIL_SP_THREAD_YIELD_HPP_INCLUDED
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
// Copyright 2023 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// boost/smart_ptr/detail/sp_thread_yield.hpp
|
|
||||||
//
|
|
||||||
// inline void bost::detail::sp_thread_yield();
|
|
||||||
//
|
|
||||||
// Gives up the remainder of the time slice,
|
|
||||||
// as if by calling sched_yield().
|
|
||||||
//
|
|
||||||
// Copyright 2008, 2020 Peter Dimov
|
|
||||||
// Distributed under the Boost Software License, Version 1.0
|
|
||||||
// https://www.boost.org/LICENSE_1_0.txt
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/core/yield_primitives.hpp>
|
||||||
#include <boost/config/pragma_message.hpp>
|
#include <boost/config/header_deprecated.hpp>
|
||||||
|
|
||||||
#if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
|
BOOST_HEADER_DEPRECATED( "<boost/core/yield_primitives.hpp>" )
|
||||||
|
|
||||||
#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
|
|
||||||
BOOST_PRAGMA_MESSAGE("Using Sleep(0) in sp_thread_yield")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <boost/smart_ptr/detail/sp_win32_sleep.hpp>
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
|
||||||
inline void sp_thread_yield()
|
using boost::core::sp_thread_yield;
|
||||||
{
|
|
||||||
Sleep( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#elif defined(BOOST_HAS_SCHED_YIELD)
|
|
||||||
|
|
||||||
#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
|
|
||||||
BOOST_PRAGMA_MESSAGE("Using sched_yield() in sp_thread_yield")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _AIX
|
|
||||||
# include <sched.h>
|
|
||||||
#else
|
|
||||||
// AIX's sched.h defines ::var which sometimes conflicts with Lambda's var
|
|
||||||
extern "C" int sched_yield(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
inline void sp_thread_yield()
|
|
||||||
{
|
|
||||||
sched_yield();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
|
|
||||||
BOOST_PRAGMA_MESSAGE("Using sp_thread_pause() in sp_thread_yield")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <boost/smart_ptr/detail/sp_thread_pause.hpp>
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
inline void sp_thread_yield()
|
|
||||||
{
|
|
||||||
sp_thread_pause();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_YIELD_HPP_INCLUDED
|
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_YIELD_HPP_INCLUDED
|
||||||
|
@@ -1,49 +0,0 @@
|
|||||||
#ifndef BOOST_SMART_PTR_DETAIL_SP_WIN32_SLEEP_HPP_INCLUDED
|
|
||||||
#define BOOST_SMART_PTR_DETAIL_SP_WIN32_SLEEP_HPP_INCLUDED
|
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// boost/smart_ptr/detail/sp_win32_sleep.hpp
|
|
||||||
//
|
|
||||||
// Declares the Win32 Sleep() function.
|
|
||||||
//
|
|
||||||
// Copyright 2008, 2020 Peter Dimov
|
|
||||||
// Distributed under the Boost Software License, Version 1.0
|
|
||||||
// https://www.boost.org/LICENSE_1_0.txt
|
|
||||||
|
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
|
||||||
# include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
#if !defined( BOOST_USE_WINDOWS_H )
|
|
||||||
|
|
||||||
#if defined(__clang__) && defined(__x86_64__)
|
|
||||||
// clang x64 warns that __stdcall is ignored
|
|
||||||
# define BOOST_SP_STDCALL
|
|
||||||
#else
|
|
||||||
# define BOOST_SP_STDCALL __stdcall
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__LP64__) // Cygwin 64
|
|
||||||
extern "C" __declspec(dllimport) void BOOST_SP_STDCALL Sleep( unsigned int ms );
|
|
||||||
#else
|
|
||||||
extern "C" __declspec(dllimport) void BOOST_SP_STDCALL Sleep( unsigned long ms );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef BOOST_SP_STDCALL
|
|
||||||
|
|
||||||
#endif // !defined( BOOST_USE_WINDOWS_H )
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_WIN32_SLEEP_HPP_INCLUDED
|
|
@@ -30,7 +30,16 @@ class spinlock
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
unsigned char v_;
|
// `bool` alignment is required for Apple PPC32
|
||||||
|
// https://github.com/boostorg/smart_ptr/issues/105
|
||||||
|
// https://github.com/PurpleI2P/i2pd/issues/1726
|
||||||
|
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107590
|
||||||
|
|
||||||
|
union
|
||||||
|
{
|
||||||
|
unsigned char v_;
|
||||||
|
bool align_;
|
||||||
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -80,6 +89,6 @@ public:
|
|||||||
} // namespace detail
|
} // namespace detail
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#define BOOST_DETAIL_SPINLOCK_INIT {0}
|
#define BOOST_DETAIL_SPINLOCK_INIT {{0}}
|
||||||
|
|
||||||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_GCC_ATOMIC_HPP_INCLUDED
|
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_GCC_ATOMIC_HPP_INCLUDED
|
||||||
|
@@ -19,9 +19,7 @@
|
|||||||
// Distributed under the Boost Software License, Version 1.0.
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
// https://www.boost.org/LICENSE_1_0.txt
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
#include <boost/smart_ptr/detail/sp_thread_pause.hpp>
|
#include <boost/core/yield_primitives.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_thread_sleep.hpp>
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
@@ -34,13 +32,13 @@ inline void yield( unsigned k )
|
|||||||
// Experiments on Windows and Fedora 32 show that a single pause,
|
// Experiments on Windows and Fedora 32 show that a single pause,
|
||||||
// followed by an immediate sp_thread_sleep(), is best.
|
// followed by an immediate sp_thread_sleep(), is best.
|
||||||
|
|
||||||
if( k == 0 )
|
if( k & 1 )
|
||||||
{
|
{
|
||||||
sp_thread_pause();
|
boost::core::sp_thread_sleep();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sp_thread_sleep();
|
boost::core::sp_thread_pause();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
//
|
//
|
||||||
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/smart_ptr/enable_shared_from_this.hpp>
|
#include <boost/smart_ptr/enable_shared_from_this.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
||||||
|
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/smart_ptr/weak_ptr.hpp>
|
#include <boost/smart_ptr/weak_ptr.hpp>
|
||||||
#include <boost/smart_ptr/shared_ptr.hpp>
|
#include <boost/smart_ptr/shared_ptr.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
||||||
|
@@ -13,6 +13,8 @@
|
|||||||
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
@@ -245,17 +247,6 @@ template<class T, class U> inline bool operator!=(T * a, intrusive_ptr<U> const
|
|||||||
return a != b.get();
|
return a != b.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96
|
|
||||||
|
|
||||||
// Resolve the ambiguity between our op!= and the one in rel_ops
|
|
||||||
|
|
||||||
template<class T> inline bool operator!=(intrusive_ptr<T> const & a, intrusive_ptr<T> const & b) BOOST_SP_NOEXCEPT
|
|
||||||
{
|
|
||||||
return a.get() != b.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_NULLPTR )
|
#if !defined( BOOST_NO_CXX11_NULLPTR )
|
||||||
|
|
||||||
template<class T> inline bool operator==( intrusive_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT
|
template<class T> inline bool operator==( intrusive_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
//
|
//
|
||||||
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/smart_ptr/shared_ptr.hpp>
|
#include <boost/smart_ptr/shared_ptr.hpp>
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
//
|
//
|
||||||
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/smart_ptr/make_local_shared_object.hpp>
|
#include <boost/smart_ptr/make_local_shared_object.hpp>
|
||||||
#include <boost/smart_ptr/make_local_shared_array.hpp>
|
#include <boost/smart_ptr/make_local_shared_array.hpp>
|
||||||
|
|
||||||
|
@@ -9,6 +9,7 @@ Distributed under the Boost Software License, Version 1.0.
|
|||||||
#ifndef BOOST_SMART_PTR_MAKE_LOCAL_SHARED_ARRAY_HPP
|
#ifndef BOOST_SMART_PTR_MAKE_LOCAL_SHARED_ARRAY_HPP
|
||||||
#define BOOST_SMART_PTR_MAKE_LOCAL_SHARED_ARRAY_HPP
|
#define BOOST_SMART_PTR_MAKE_LOCAL_SHARED_ARRAY_HPP
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/core/default_allocator.hpp>
|
#include <boost/core/default_allocator.hpp>
|
||||||
#include <boost/smart_ptr/allocate_local_shared_array.hpp>
|
#include <boost/smart_ptr/allocate_local_shared_array.hpp>
|
||||||
|
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
//
|
//
|
||||||
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/smart_ptr/local_shared_ptr.hpp>
|
#include <boost/smart_ptr/local_shared_ptr.hpp>
|
||||||
#include <boost/smart_ptr/make_shared.hpp>
|
#include <boost/smart_ptr/make_shared.hpp>
|
||||||
#include <boost/type_traits/remove_const.hpp>
|
#include <boost/type_traits/remove_const.hpp>
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
//
|
//
|
||||||
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/smart_ptr/make_shared_object.hpp>
|
#include <boost/smart_ptr/make_shared_object.hpp>
|
||||||
|
|
||||||
#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined( BOOST_NO_SFINAE )
|
#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined( BOOST_NO_SFINAE )
|
||||||
|
@@ -8,6 +8,7 @@ Distributed under the Boost Software License, Version 1.0.
|
|||||||
#ifndef BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP
|
#ifndef BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP
|
||||||
#define BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP
|
#define BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/core/default_allocator.hpp>
|
#include <boost/core/default_allocator.hpp>
|
||||||
#include <boost/smart_ptr/allocate_shared_array.hpp>
|
#include <boost/smart_ptr/allocate_shared_array.hpp>
|
||||||
|
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
//
|
//
|
||||||
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/move/core.hpp>
|
#include <boost/move/core.hpp>
|
||||||
#include <boost/move/utility_core.hpp>
|
#include <boost/move/utility_core.hpp>
|
||||||
|
@@ -8,6 +8,7 @@ Distributed under the Boost Software License, Version 1.0.
|
|||||||
#ifndef BOOST_SMART_PTR_MAKE_UNIQUE_HPP
|
#ifndef BOOST_SMART_PTR_MAKE_UNIQUE_HPP
|
||||||
#define BOOST_SMART_PTR_MAKE_UNIQUE_HPP
|
#define BOOST_SMART_PTR_MAKE_UNIQUE_HPP
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/type_traits/enable_if.hpp>
|
#include <boost/type_traits/enable_if.hpp>
|
||||||
#include <boost/type_traits/is_array.hpp>
|
#include <boost/type_traits/is_array.hpp>
|
||||||
#include <boost/type_traits/is_unbounded_array.hpp>
|
#include <boost/type_traits/is_unbounded_array.hpp>
|
||||||
|
@@ -10,9 +10,10 @@
|
|||||||
//
|
//
|
||||||
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <boost/checked_delete.hpp>
|
#include <boost/core/checked_delete.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
|
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
||||||
|
|
||||||
|
@@ -10,9 +10,10 @@
|
|||||||
//
|
//
|
||||||
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <boost/checked_delete.hpp>
|
#include <boost/core/checked_delete.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
|
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_disable_deprecated.hpp>
|
#include <boost/smart_ptr/detail/sp_disable_deprecated.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
||||||
|
@@ -14,12 +14,14 @@
|
|||||||
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
|
|
||||||
#include <boost/config.hpp> // for broken compiler workarounds
|
#include <boost/config.hpp> // for broken compiler workarounds
|
||||||
|
|
||||||
#include <memory> // TR1 cyclic inclusion fix
|
#include <memory> // TR1 cyclic inclusion fix
|
||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <boost/checked_delete.hpp>
|
#include <boost/core/checked_delete.hpp>
|
||||||
|
|
||||||
#include <boost/smart_ptr/shared_ptr.hpp>
|
#include <boost/smart_ptr/shared_ptr.hpp>
|
||||||
#include <boost/smart_ptr/detail/shared_count.hpp>
|
#include <boost/smart_ptr/detail/shared_count.hpp>
|
||||||
|
@@ -14,12 +14,13 @@
|
|||||||
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/smart_ptr/detail/shared_count.hpp>
|
#include <boost/smart_ptr/detail/shared_count.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_convertible.hpp>
|
#include <boost/smart_ptr/detail/sp_convertible.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
|
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_disable_deprecated.hpp>
|
#include <boost/smart_ptr/detail/sp_disable_deprecated.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
||||||
#include <boost/checked_delete.hpp>
|
#include <boost/core/checked_delete.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
@@ -667,9 +668,8 @@ public:
|
|||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||||
|
|
||||||
shared_ptr( shared_ptr && r ) BOOST_SP_NOEXCEPT : px( r.px ), pn()
|
shared_ptr( shared_ptr && r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( static_cast< boost::detail::shared_count && >( r.pn ) )
|
||||||
{
|
{
|
||||||
pn.swap( r.pn );
|
|
||||||
r.px = 0;
|
r.px = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -683,11 +683,9 @@ public:
|
|||||||
shared_ptr( shared_ptr<Y> && r )
|
shared_ptr( shared_ptr<Y> && r )
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
BOOST_SP_NOEXCEPT : px( r.px ), pn()
|
BOOST_SP_NOEXCEPT : px( r.px ), pn( static_cast< boost::detail::shared_count && >( r.pn ) )
|
||||||
{
|
{
|
||||||
boost::detail::sp_assert_convertible< Y, T >();
|
boost::detail::sp_assert_convertible< Y, T >();
|
||||||
|
|
||||||
pn.swap( r.pn );
|
|
||||||
r.px = 0;
|
r.px = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -897,17 +895,6 @@ template<class T, class U> inline bool operator!=(shared_ptr<T> const & a, share
|
|||||||
return a.get() != b.get();
|
return a.get() != b.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96
|
|
||||||
|
|
||||||
// Resolve the ambiguity between our op!= and the one in rel_ops
|
|
||||||
|
|
||||||
template<class T> inline bool operator!=(shared_ptr<T> const & a, shared_ptr<T> const & b) BOOST_SP_NOEXCEPT
|
|
||||||
{
|
|
||||||
return a.get() != b.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_NULLPTR )
|
#if !defined( BOOST_NO_CXX11_NULLPTR )
|
||||||
|
|
||||||
template<class T> inline bool operator==( shared_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT
|
template<class T> inline bool operator==( shared_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <boost/smart_ptr/detail/requires_cxx11.hpp>
|
||||||
#include <boost/smart_ptr/detail/shared_count.hpp>
|
#include <boost/smart_ptr/detail/shared_count.hpp>
|
||||||
#include <boost/smart_ptr/shared_ptr.hpp>
|
#include <boost/smart_ptr/shared_ptr.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
|
||||||
|
54
test/Jamfile
54
test/Jamfile
@@ -8,6 +8,7 @@
|
|||||||
# http://www.boost.org/LICENSE_1_0.txt)
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
import testing ;
|
import testing ;
|
||||||
|
import ../../config/checks/config : requires ;
|
||||||
|
|
||||||
project
|
project
|
||||||
: requirements
|
: requirements
|
||||||
@@ -16,6 +17,8 @@ project
|
|||||||
#<toolset>gcc:<cxxflags>-Wno-delete-non-virtual-dtor (not in 4.4/4.6)
|
#<toolset>gcc:<cxxflags>-Wno-delete-non-virtual-dtor (not in 4.4/4.6)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
local cnhash = [ requires cxx11_decltype cxx11_noexcept ] <toolset>gcc-4.6:<build>no ;
|
||||||
|
|
||||||
# quick test (for CI)
|
# quick test (for CI)
|
||||||
run quick.cpp ;
|
run quick.cpp ;
|
||||||
|
|
||||||
@@ -64,7 +67,13 @@ run spinlock_pool_test.cpp
|
|||||||
<toolset>msvc-9.0,<variant>release:<build>no ;
|
<toolset>msvc-9.0,<variant>release:<build>no ;
|
||||||
|
|
||||||
run make_shared_test.cpp ;
|
run make_shared_test.cpp ;
|
||||||
run make_shared_move_emulation_test.cpp ;
|
run make_shared_move_emulation_test.cpp
|
||||||
|
: : :
|
||||||
|
<toolset>clang-3.5,<cxxstd>03:<build>no
|
||||||
|
<toolset>clang-3.6,<cxxstd>03:<build>no
|
||||||
|
<toolset>clang-3.7,<cxxstd>03:<build>no
|
||||||
|
;
|
||||||
|
|
||||||
run make_shared_perfect_forwarding_test.cpp ;
|
run make_shared_perfect_forwarding_test.cpp ;
|
||||||
run shared_ptr_convertible_test.cpp ;
|
run shared_ptr_convertible_test.cpp ;
|
||||||
run wp_convertible_test.cpp ;
|
run wp_convertible_test.cpp ;
|
||||||
@@ -86,9 +95,11 @@ compile-fail auto_ptr_lv_fail.cpp
|
|||||||
run atomic_count_test2.cpp ;
|
run atomic_count_test2.cpp ;
|
||||||
run sp_typeinfo_test.cpp ;
|
run sp_typeinfo_test.cpp ;
|
||||||
compile make_shared_fp_test.cpp ;
|
compile make_shared_fp_test.cpp ;
|
||||||
run sp_hash_test.cpp ;
|
run sp_hash_test.cpp
|
||||||
|
: : : $(cnhash) ;
|
||||||
run get_deleter_array_test.cpp ;
|
run get_deleter_array_test.cpp ;
|
||||||
run ip_hash_test.cpp ;
|
run ip_hash_test.cpp
|
||||||
|
: : : $(cnhash) ;
|
||||||
run owner_less_test.cpp ;
|
run owner_less_test.cpp ;
|
||||||
run sp_unique_ptr_test.cpp ;
|
run sp_unique_ptr_test.cpp ;
|
||||||
run sp_array_test.cpp ;
|
run sp_array_test.cpp ;
|
||||||
@@ -215,8 +226,10 @@ run weak_from_this_test2.cpp ;
|
|||||||
|
|
||||||
run sp_bml_unique_ptr_test.cpp ;
|
run sp_bml_unique_ptr_test.cpp ;
|
||||||
|
|
||||||
run sp_hash_test2.cpp ;
|
run sp_hash_test2.cpp
|
||||||
run sp_hash_test3.cpp ;
|
: : : $(cnhash) ;
|
||||||
|
run sp_hash_test3.cpp
|
||||||
|
: : : $(cnhash) ;
|
||||||
|
|
||||||
run pointer_cast_test2.cpp ;
|
run pointer_cast_test2.cpp ;
|
||||||
|
|
||||||
@@ -306,7 +319,7 @@ lib dll_test : dll_test_lib.cpp : <link>shared:<define>DLL_TEST_DYN_LINK=1 ;
|
|||||||
explicit dll_test ;
|
explicit dll_test ;
|
||||||
|
|
||||||
run dll_test_main.cpp dll_test : : : <link>static : dll_test_static ;
|
run dll_test_main.cpp dll_test : : : <link>static : dll_test_static ;
|
||||||
run dll_test_main.cpp dll_test : : : <link>shared : dll_test_shared ;
|
run dll_test_main.cpp dll_test : : : <link>shared <undefined-sanitizer>norecover:<build>no : dll_test_shared ;
|
||||||
|
|
||||||
run make_shared_const_test.cpp ;
|
run make_shared_const_test.cpp ;
|
||||||
run make_local_shared_const_test.cpp ;
|
run make_local_shared_const_test.cpp ;
|
||||||
@@ -352,6 +365,7 @@ run allocate_unique_noinit_test.cpp ;
|
|||||||
run allocate_unique_test.cpp ;
|
run allocate_unique_test.cpp ;
|
||||||
run allocate_unique_throws_test.cpp ;
|
run allocate_unique_throws_test.cpp ;
|
||||||
run allocate_unique_value_test.cpp ;
|
run allocate_unique_value_test.cpp ;
|
||||||
|
run get_allocator_pointer_test.cpp ;
|
||||||
|
|
||||||
run sp_guides_test.cpp ;
|
run sp_guides_test.cpp ;
|
||||||
run sp_guides_test2.cpp ;
|
run sp_guides_test2.cpp ;
|
||||||
@@ -361,11 +375,18 @@ compile-fail shared_from_fail.cpp ;
|
|||||||
compile-fail weak_from_fail.cpp ;
|
compile-fail weak_from_fail.cpp ;
|
||||||
|
|
||||||
compile sp_override_test.cpp ;
|
compile sp_override_test.cpp ;
|
||||||
|
|
||||||
|
local gcc-flags = -Wundef ;
|
||||||
|
|
||||||
compile sp_pedantic_test.cpp
|
compile sp_pedantic_test.cpp
|
||||||
: <warnings>pedantic
|
: <warnings>pedantic
|
||||||
<toolset>msvc:<warnings-as-errors>on
|
<toolset>msvc:<warnings-as-errors>on
|
||||||
<toolset>gcc:<warnings-as-errors>on
|
<toolset>gcc:<warnings-as-errors>on
|
||||||
<toolset>clang:<warnings-as-errors>on ;
|
<toolset>gcc:<cxxflags>$(gcc-flags)
|
||||||
|
<toolset>clang:<warnings-as-errors>on
|
||||||
|
<toolset>clang:<cxxflags>$(gcc-flags)
|
||||||
|
<toolset>clang-15:<cxxflags>-Wno-deprecated-builtins
|
||||||
|
;
|
||||||
|
|
||||||
run sp_owner_before_test.cpp ;
|
run sp_owner_before_test.cpp ;
|
||||||
run sp_owner_equals_test.cpp ;
|
run sp_owner_equals_test.cpp ;
|
||||||
@@ -379,29 +400,34 @@ run owner_less_test2.cpp ;
|
|||||||
|
|
||||||
run ip_hash_test2.cpp ;
|
run ip_hash_test2.cpp ;
|
||||||
run sp_hash_test4.cpp ;
|
run sp_hash_test4.cpp ;
|
||||||
run lsp_hash_test.cpp ;
|
|
||||||
|
run lsp_hash_test.cpp
|
||||||
|
: : : $(cnhash) ;
|
||||||
run lsp_hash_test2.cpp ;
|
run lsp_hash_test2.cpp ;
|
||||||
|
|
||||||
|
local MT = <threading>multi [ requires cxx11_decltype cxx11_noexcept ] <toolset>gcc-4.6:<build>no ;
|
||||||
|
|
||||||
run atomic_count_mt_test.cpp
|
run atomic_count_mt_test.cpp
|
||||||
: : : <threading>multi ;
|
: : : $(MT) ;
|
||||||
|
|
||||||
run spinlock_mt_test.cpp
|
run spinlock_mt_test.cpp
|
||||||
: : : <threading>multi ;
|
: : : $(MT) ;
|
||||||
|
|
||||||
run spinlock_pool_mt_test.cpp
|
run spinlock_pool_mt_test.cpp
|
||||||
: : : <threading>multi ;
|
: : : $(MT) ;
|
||||||
|
|
||||||
run shared_ptr_mt_test.cpp
|
run shared_ptr_mt_test.cpp
|
||||||
: : : <threading>multi ;
|
: : : $(MT) ;
|
||||||
|
|
||||||
run weak_ptr_mt_test.cpp
|
run weak_ptr_mt_test.cpp
|
||||||
: : : <threading>multi ;
|
: : : $(MT) ;
|
||||||
|
|
||||||
compile sp_report_implementation.cpp ;
|
compile sp_report_implementation.cpp ;
|
||||||
|
|
||||||
run sp_owner_hash_value_test.cpp ;
|
run sp_owner_hash_value_test.cpp ;
|
||||||
|
|
||||||
run wp_hash_test.cpp ;
|
run wp_hash_test.cpp
|
||||||
|
: : : $(cnhash) ;
|
||||||
run wp_hash_test2.cpp ;
|
run wp_hash_test2.cpp ;
|
||||||
|
|
||||||
run wp_unordered_test.cpp ;
|
run wp_unordered_test.cpp ;
|
||||||
|
250
test/get_allocator_pointer_test.cpp
Normal file
250
test/get_allocator_pointer_test.cpp
Normal file
@@ -0,0 +1,250 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2021 Glen Joseph Fernandes
|
||||||
|
(glenjofe@gmail.com)
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0.
|
||||||
|
(http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
*/
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#if (!defined(BOOST_LIBSTDCXX_VERSION) || \
|
||||||
|
BOOST_LIBSTDCXX_VERSION >= 46000) && \
|
||||||
|
!defined(BOOST_NO_CXX11_SMART_PTR)
|
||||||
|
#include <boost/smart_ptr/allocate_unique.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
class point {
|
||||||
|
public:
|
||||||
|
point()
|
||||||
|
: state_()
|
||||||
|
, ptr_() { }
|
||||||
|
|
||||||
|
point(int count, T* value)
|
||||||
|
: state_(count)
|
||||||
|
, ptr_(value) { }
|
||||||
|
|
||||||
|
operator bool() const {
|
||||||
|
return static_cast<bool>(ptr_);
|
||||||
|
}
|
||||||
|
|
||||||
|
T* operator->() const {
|
||||||
|
return ptr_;
|
||||||
|
}
|
||||||
|
|
||||||
|
int state() const {
|
||||||
|
return state_;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
int state_;
|
||||||
|
T* ptr_;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T = void>
|
||||||
|
class creator {
|
||||||
|
public:
|
||||||
|
typedef T value_type;
|
||||||
|
typedef point<T> pointer;
|
||||||
|
typedef std::ptrdiff_t difference_type;
|
||||||
|
|
||||||
|
creator()
|
||||||
|
: state_() { }
|
||||||
|
|
||||||
|
explicit creator(int value)
|
||||||
|
: state_(value) { }
|
||||||
|
|
||||||
|
template<class U>
|
||||||
|
creator(const creator<U>& other)
|
||||||
|
: state_(other.state()) { }
|
||||||
|
|
||||||
|
pointer allocate(std::size_t size) {
|
||||||
|
return pointer(state_,
|
||||||
|
static_cast<T*>(::operator new(sizeof(T) * size)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void deallocate(pointer ptr, std::size_t) {
|
||||||
|
::operator delete(ptr.operator->());
|
||||||
|
}
|
||||||
|
|
||||||
|
int state() const {
|
||||||
|
return state_;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
int state_;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T, class U>
|
||||||
|
inline bool
|
||||||
|
operator==(const creator<T>&, const creator<U>&)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class T, class U>
|
||||||
|
inline bool
|
||||||
|
operator!=(const creator<T>&, const creator<U>&)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
{
|
||||||
|
std::unique_ptr<int,
|
||||||
|
boost::alloc_deleter<int, creator<> > > result =
|
||||||
|
boost::allocate_unique<int>(creator<>(1));
|
||||||
|
point<int> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 1);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<const int,
|
||||||
|
boost::alloc_deleter<const int, creator<> > > result =
|
||||||
|
boost::allocate_unique<const int>(creator<>(2));
|
||||||
|
point<int> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 2);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<int[],
|
||||||
|
boost::alloc_deleter<int[], creator<> > > result =
|
||||||
|
boost::allocate_unique<int[]>(creator<>(3), 3);
|
||||||
|
point<int> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 3);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<int[],
|
||||||
|
boost::alloc_deleter<int[3], creator<> > > result =
|
||||||
|
boost::allocate_unique<int[3]>(creator<>(4));
|
||||||
|
point<int> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 4);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<int[][2],
|
||||||
|
boost::alloc_deleter<int[][2], creator<> > > result =
|
||||||
|
boost::allocate_unique<int[][2]>(creator<>(5), 2);
|
||||||
|
point<int[2]> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 5);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<int[][2],
|
||||||
|
boost::alloc_deleter<int[2][2], creator<> > > result =
|
||||||
|
boost::allocate_unique<int[2][2]>(creator<>(6));
|
||||||
|
point<int[2]> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 6);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<const int[],
|
||||||
|
boost::alloc_deleter<const int[], creator<> > > result =
|
||||||
|
boost::allocate_unique<const int[]>(creator<>(7), 3);
|
||||||
|
point<int> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 7);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<const int[],
|
||||||
|
boost::alloc_deleter<const int[3], creator<> > > result =
|
||||||
|
boost::allocate_unique<const int[3]>(creator<>(8));
|
||||||
|
point<int> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 8);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<const int[][2],
|
||||||
|
boost::alloc_deleter<const int[][2], creator<> > > result =
|
||||||
|
boost::allocate_unique<const int[][2]>(creator<>(9), 2);
|
||||||
|
point<int[2]> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 9);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<const int[][2],
|
||||||
|
boost::alloc_deleter<const int[2][2], creator<> > > result =
|
||||||
|
boost::allocate_unique<const int[2][2]>(creator<>(10));
|
||||||
|
point<int[2]> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 10);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<int,
|
||||||
|
boost::alloc_deleter<int,
|
||||||
|
boost::noinit_adaptor<creator<> > > > result =
|
||||||
|
boost::allocate_unique_noinit<int>(creator<>(11));
|
||||||
|
point<int> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 11);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<const int,
|
||||||
|
boost::alloc_deleter<const int,
|
||||||
|
boost::noinit_adaptor<creator<> > > > result =
|
||||||
|
boost::allocate_unique_noinit<const int>(creator<>(12));
|
||||||
|
point<int> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 12);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<int[],
|
||||||
|
boost::alloc_deleter<int[],
|
||||||
|
boost::noinit_adaptor<creator<> > > > result =
|
||||||
|
boost::allocate_unique_noinit<int[]>(creator<>(13), 3);
|
||||||
|
point<int> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 13);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<int[],
|
||||||
|
boost::alloc_deleter<int[3],
|
||||||
|
boost::noinit_adaptor<creator<> > > > result =
|
||||||
|
boost::allocate_unique_noinit<int[3]>(creator<>(14));
|
||||||
|
point<int> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 14);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<int[][2],
|
||||||
|
boost::alloc_deleter<int[][2],
|
||||||
|
boost::noinit_adaptor<creator<> > > > result =
|
||||||
|
boost::allocate_unique_noinit<int[][2]>(creator<>(15), 2);
|
||||||
|
point<int[2]> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 15);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<int[][2],
|
||||||
|
boost::alloc_deleter<int[2][2],
|
||||||
|
boost::noinit_adaptor<creator<> > > > result =
|
||||||
|
boost::allocate_unique_noinit<int[2][2]>(creator<>(16));
|
||||||
|
point<int[2]> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 16);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<const int[],
|
||||||
|
boost::alloc_deleter<const int[],
|
||||||
|
boost::noinit_adaptor<creator<> > > > result =
|
||||||
|
boost::allocate_unique_noinit<const int[]>(creator<>(17), 3);
|
||||||
|
point<int> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 17);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<const int[],
|
||||||
|
boost::alloc_deleter<const int[3],
|
||||||
|
boost::noinit_adaptor<creator<> > > > result =
|
||||||
|
boost::allocate_unique_noinit<const int[3]>(creator<>(18));
|
||||||
|
point<int> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 18);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<const int[][2],
|
||||||
|
boost::alloc_deleter<const int[][2],
|
||||||
|
boost::noinit_adaptor<creator<> > > > result =
|
||||||
|
boost::allocate_unique_noinit<const int[][2]>(creator<>(19), 2);
|
||||||
|
point<int[2]> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 19);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_ptr<const int[][2],
|
||||||
|
boost::alloc_deleter<const int[2][2],
|
||||||
|
boost::noinit_adaptor<creator<> > > > result =
|
||||||
|
boost::allocate_unique_noinit<const int[2][2]>(creator<>(20));
|
||||||
|
point<int[2]> ptr = boost::get_allocator_pointer(result);
|
||||||
|
BOOST_TEST_EQ(ptr.state(), 20);
|
||||||
|
}
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
@@ -9,7 +9,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <boost/intrusive_ptr.hpp>
|
#include <boost/intrusive_ptr.hpp>
|
||||||
#include <boost/functional/hash.hpp>
|
#include <boost/container_hash/hash.hpp>
|
||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
|
||||||
class base
|
class base
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
// https://www.boost.org/LICENSE_1_0.txt
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
#include <boost/smart_ptr/local_shared_ptr.hpp>
|
#include <boost/smart_ptr/local_shared_ptr.hpp>
|
||||||
#include <boost/functional/hash.hpp>
|
#include <boost/container_hash/hash.hpp>
|
||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
@@ -296,8 +296,6 @@ void test()
|
|||||||
BOOST_TEST( sup2.use_count() == 2 );
|
BOOST_TEST( sup2.use_count() == 2 );
|
||||||
|
|
||||||
std::cout << "OK\n";
|
std::cout << "OK\n";
|
||||||
|
|
||||||
new char[12345]; // deliberate memory leak to verify leaks detected
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <boost/functional/hash.hpp>
|
#include <boost/container_hash/hash.hpp>
|
||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <boost/functional/hash.hpp>
|
#include <boost/container_hash/hash.hpp>
|
||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <boost/functional/hash.hpp>
|
#include <boost/container_hash/hash.hpp>
|
||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <boost/weak_ptr.hpp>
|
#include <boost/weak_ptr.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <boost/functional/hash.hpp>
|
#include <boost/container_hash/hash.hpp>
|
||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
Reference in New Issue
Block a user