!94 升级到1.80.0
From: @sdlzx Reviewed-by: @liqingqing_1229 Signed-off-by: @liqingqing_1229
This commit is contained in:
commit
cb9eb41e80
@ -1,355 +0,0 @@
|
|||||||
From aebac1401f9ddabb84c222481301d25beea1988d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andrey Semashev <andrey.semashev@gmail.com>
|
|
||||||
Date: Mon, 14 Jan 2019 21:08:25 +0300
|
|
||||||
Subject: [PATCH 1/2] Remove linking with Boost.System.
|
|
||||||
|
|
||||||
Since Boost.System is header-only now, no need to link with the library.
|
|
||||||
---
|
|
||||||
build/Jamfile.v2 | 3 ---
|
|
||||||
1 file changed, 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/libs/locale/build/Jamfile.v2 b/libs/locale/build/Jamfile.v2
|
|
||||||
index 578e722e..43ab0014 100644
|
|
||||||
--- a/libs/locale/build/Jamfile.v2
|
|
||||||
+++ b/libs/locale/build/Jamfile.v2
|
|
||||||
@@ -382,9 +382,6 @@ rule configure-full ( properties * : flags-only )
|
|
||||||
result += <source>util/gregorian.cpp ;
|
|
||||||
}
|
|
||||||
|
|
||||||
- result += <library>../../system/build//boost_system ;
|
|
||||||
-
|
|
||||||
-
|
|
||||||
if "$(flags-only)" = "flags"
|
|
||||||
{
|
|
||||||
return $(flags-result) ;
|
|
||||||
|
|
||||||
From b01aab1d28c9b32d107ae39c76c9af988420d476 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andrey Semashev <andrey.semashev@gmail.com>
|
|
||||||
Date: Mon, 14 Jan 2019 21:10:38 +0300
|
|
||||||
Subject: [PATCH 2/2] Trim trailing spaces.
|
|
||||||
|
|
||||||
---
|
|
||||||
build/Jamfile.v2 | 119 +++++++++++++++++++++++------------------------
|
|
||||||
1 file changed, 59 insertions(+), 60 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/libs/locale/build/Jamfile.v2 b/libs/locale/build/Jamfile.v2
|
|
||||||
index 43ab0014..97dd68c7 100644
|
|
||||||
--- a/libs/locale/build/Jamfile.v2
|
|
||||||
+++ b/libs/locale/build/Jamfile.v2
|
|
||||||
@@ -1,6 +1,6 @@
|
|
||||||
# copyright John Maddock 2003, Artyom Beilis 2010
|
|
||||||
-# Distributed under the Boost Software License, Version 1.0.
|
|
||||||
-# (See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
+# Distributed under the Boost Software License, Version 1.0.
|
|
||||||
+# (See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
# http://www.boost.org/LICENSE_1_0.txt.
|
|
||||||
|
|
||||||
|
|
||||||
@@ -32,11 +32,11 @@ explicit has_iconv ;
|
|
||||||
|
|
||||||
ICONV_PATH = [ modules.peek : ICONV_PATH ] ;
|
|
||||||
|
|
||||||
-lib iconv
|
|
||||||
- :
|
|
||||||
+lib iconv
|
|
||||||
+ :
|
|
||||||
: <search>$(ICONV_PATH)/lib <link>shared <runtime-link>shared
|
|
||||||
:
|
|
||||||
- : <include>$(ICONV_PATH)/include
|
|
||||||
+ : <include>$(ICONV_PATH)/include
|
|
||||||
;
|
|
||||||
|
|
||||||
explicit iconv ;
|
|
||||||
@@ -45,8 +45,8 @@ obj has_iconv_libc_ext : ../build/has_iconv.cpp iconv ;
|
|
||||||
exe has_external_iconv : has_iconv_libc_ext iconv ;
|
|
||||||
explicit has_external_iconv ;
|
|
||||||
|
|
||||||
-exe accepts_shared_option : ../build/option.cpp
|
|
||||||
- : <cxxflags>-shared-libstdc++
|
|
||||||
+exe accepts_shared_option : ../build/option.cpp
|
|
||||||
+ : <cxxflags>-shared-libstdc++
|
|
||||||
<cxxflags>-shared-libgcc
|
|
||||||
<linkflags>-shared-libstdc++
|
|
||||||
<linkflags>-shared-libgcc
|
|
||||||
@@ -71,8 +71,8 @@ if $(ICU_LINK)
|
|
||||||
else
|
|
||||||
{
|
|
||||||
searched-lib icuuc : : <name>icuuc
|
|
||||||
- <search>$(ICU_PATH)/lib
|
|
||||||
- <link>shared
|
|
||||||
+ <search>$(ICU_PATH)/lib
|
|
||||||
+ <link>shared
|
|
||||||
<runtime-link>shared ;
|
|
||||||
|
|
||||||
searched-lib icuuc : : <toolset>msvc
|
|
||||||
@@ -120,9 +120,9 @@ else
|
|
||||||
|
|
||||||
explicit icuuc icudt icuin ;
|
|
||||||
|
|
||||||
- ICU_OPTS = <include>$(ICU_PATH)/include
|
|
||||||
- <library>icuuc/<link>shared/<runtime-link>shared
|
|
||||||
- <library>icudt/<link>shared/<runtime-link>shared
|
|
||||||
+ ICU_OPTS = <include>$(ICU_PATH)/include
|
|
||||||
+ <library>icuuc/<link>shared/<runtime-link>shared
|
|
||||||
+ <library>icudt/<link>shared/<runtime-link>shared
|
|
||||||
<library>icuin/<link>shared/<runtime-link>shared
|
|
||||||
<dll-path>$(ICU_PATH)/bin
|
|
||||||
<runtime-link>shared ;
|
|
||||||
@@ -130,8 +130,8 @@ else
|
|
||||||
|
|
||||||
|
|
||||||
searched-lib icuuc_64 : : <name>icuuc
|
|
||||||
- <search>$(ICU_PATH)/lib64
|
|
||||||
- <link>shared
|
|
||||||
+ <search>$(ICU_PATH)/lib64
|
|
||||||
+ <link>shared
|
|
||||||
<runtime-link>shared ;
|
|
||||||
|
|
||||||
searched-lib icuuc_64 : : <toolset>msvc
|
|
||||||
@@ -179,14 +179,14 @@ else
|
|
||||||
|
|
||||||
explicit icuuc_64 icudt_64 icuin_64 ;
|
|
||||||
|
|
||||||
- ICU64_OPTS = <include>$(ICU_PATH)/include
|
|
||||||
- <library>icuuc_64/<link>shared/<runtime-link>shared
|
|
||||||
- <library>icudt_64/<link>shared/<runtime-link>shared
|
|
||||||
+ ICU64_OPTS = <include>$(ICU_PATH)/include
|
|
||||||
+ <library>icuuc_64/<link>shared/<runtime-link>shared
|
|
||||||
+ <library>icudt_64/<link>shared/<runtime-link>shared
|
|
||||||
<library>icuin_64/<link>shared/<runtime-link>shared
|
|
||||||
<dll-path>$(ICU_PATH)/bin64
|
|
||||||
<runtime-link>shared ;
|
|
||||||
-
|
|
||||||
-
|
|
||||||
+
|
|
||||||
+
|
|
||||||
}
|
|
||||||
|
|
||||||
obj has_icu_obj : ../build/has_icu_test.cpp : $(ICU_OPTS) ;
|
|
||||||
@@ -206,11 +206,11 @@ rule configure-full ( properties * : flags-only )
|
|
||||||
|
|
||||||
local result ;
|
|
||||||
local flags-result ;
|
|
||||||
-
|
|
||||||
+
|
|
||||||
local found-iconv ;
|
|
||||||
-
|
|
||||||
+
|
|
||||||
if <boost.locale.iconv>on in $(properties)
|
|
||||||
- || ! <boost.locale.iconv> in $(properties:G)
|
|
||||||
+ || ! <boost.locale.iconv> in $(properties:G)
|
|
||||||
&& ! <target-os>solaris in $(properties)
|
|
||||||
{
|
|
||||||
# See if iconv is bundled with standard library.
|
|
||||||
@@ -218,7 +218,7 @@ rule configure-full ( properties * : flags-only )
|
|
||||||
{
|
|
||||||
found-iconv = true ;
|
|
||||||
}
|
|
||||||
- else
|
|
||||||
+ else
|
|
||||||
{
|
|
||||||
if [ configure.builds has_external_iconv : $(properties) : "iconv (separate)" ]
|
|
||||||
{
|
|
||||||
@@ -226,8 +226,8 @@ rule configure-full ( properties * : flags-only )
|
|
||||||
result += <library>iconv ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- }
|
|
||||||
- if $(found-iconv)
|
|
||||||
+ }
|
|
||||||
+ if $(found-iconv)
|
|
||||||
{
|
|
||||||
flags-result += <define>BOOST_LOCALE_WITH_ICONV=1 ;
|
|
||||||
}
|
|
||||||
@@ -249,7 +249,7 @@ rule configure-full ( properties * : flags-only )
|
|
||||||
|
|
||||||
if $(found-icu)
|
|
||||||
{
|
|
||||||
- ICU_SOURCES =
|
|
||||||
+ ICU_SOURCES =
|
|
||||||
boundary
|
|
||||||
codecvt
|
|
||||||
collator
|
|
||||||
@@ -260,20 +260,20 @@ rule configure-full ( properties * : flags-only )
|
|
||||||
numeric
|
|
||||||
time_zone
|
|
||||||
;
|
|
||||||
-
|
|
||||||
- result += <source>icu/$(ICU_SOURCES).cpp
|
|
||||||
- <library>../../thread/build//boost_thread
|
|
||||||
+
|
|
||||||
+ result += <source>icu/$(ICU_SOURCES).cpp
|
|
||||||
+ <library>../../thread/build//boost_thread
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- if ! $(found-iconv) && ! $(found-icu) && ! <target-os>windows in $(properties) && ! <target-os>cygwin in $(properties)
|
|
||||||
+
|
|
||||||
+ if ! $(found-iconv) && ! $(found-icu) && ! <target-os>windows in $(properties) && ! <target-os>cygwin in $(properties)
|
|
||||||
{
|
|
||||||
ECHO "- Boost.Locale needs either iconv or ICU library to be built." ;
|
|
||||||
result += <build>no ;
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+
|
|
||||||
if ! <boost.locale.std> in $(properties:G)
|
|
||||||
{
|
|
||||||
if <toolset>sun in $(properties)
|
|
||||||
@@ -283,9 +283,9 @@ rule configure-full ( properties * : flags-only )
|
|
||||||
else
|
|
||||||
{
|
|
||||||
properties += <boost.locale.std>on ;
|
|
||||||
- }
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+
|
|
||||||
if <boost.locale.std>off in $(properties)
|
|
||||||
{
|
|
||||||
flags-result += <define>BOOST_LOCALE_NO_STD_BACKEND=1 ;
|
|
||||||
@@ -301,38 +301,38 @@ rule configure-full ( properties * : flags-only )
|
|
||||||
;
|
|
||||||
result += <source>std/$(STD_SOURCES).cpp ;
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+
|
|
||||||
if ! <boost.locale.winapi> in $(properties:G)
|
|
||||||
{
|
|
||||||
- if <target-os>windows in $(properties)
|
|
||||||
+ if <target-os>windows in $(properties)
|
|
||||||
|| <target-os>cygwin in $(properties)
|
|
||||||
{
|
|
||||||
properties += <boost.locale.winapi>on ;
|
|
||||||
- }
|
|
||||||
+ }
|
|
||||||
else
|
|
||||||
{
|
|
||||||
properties += <boost.locale.winapi>off ;
|
|
||||||
- }
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
- if <target-os>windows in $(properties)
|
|
||||||
- && <toolset>gcc in $(properties)
|
|
||||||
+ if <target-os>windows in $(properties)
|
|
||||||
+ && <toolset>gcc in $(properties)
|
|
||||||
&& <link>shared in $(properties)
|
|
||||||
&& [ configure.builds accepts_shared_option : $(properties) : "g++ -shared-* supported" ]
|
|
||||||
{
|
|
||||||
- flags-result += <cxxflags>-shared-libstdc++
|
|
||||||
+ flags-result += <cxxflags>-shared-libstdc++
|
|
||||||
<cxxflags>-shared-libgcc
|
|
||||||
<linkflags>-shared-libstdc++
|
|
||||||
<linkflags>-shared-libgcc
|
|
||||||
;
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+
|
|
||||||
if <boost.locale.winapi>off in $(properties)
|
|
||||||
{
|
|
||||||
flags-result += <define>BOOST_LOCALE_NO_WINAPI_BACKEND=1 ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
- WINAPI_SOURCES =
|
|
||||||
+ WINAPI_SOURCES =
|
|
||||||
collate
|
|
||||||
converter
|
|
||||||
numeric
|
|
||||||
@@ -340,34 +340,34 @@ rule configure-full ( properties * : flags-only )
|
|
||||||
;
|
|
||||||
result += <source>win32/$(WINAPI_SOURCES).cpp ;
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+
|
|
||||||
if ( ! <boost.locale.winapi>off in $(properties) || ! <boost.locale.std>off in $(properties) )
|
|
||||||
&& ( <target-os>windows in $(properties) || <target-os>cygwin in $(properties) )
|
|
||||||
{
|
|
||||||
result += <source>win32/lcid.cpp ;
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+
|
|
||||||
if ! <boost.locale.posix> in $(properties:G)
|
|
||||||
{
|
|
||||||
- if <target-os>linux in $(properties)
|
|
||||||
- || <target-os>darwin in $(properties)
|
|
||||||
+ if <target-os>linux in $(properties)
|
|
||||||
+ || <target-os>darwin in $(properties)
|
|
||||||
|| ( <target-os>freebsd in $(properties) && [ configure.builds has_xlocale : $(properties) : "xlocale supported" ] )
|
|
||||||
{
|
|
||||||
properties += <boost.locale.posix>on ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
- properties += <boost.locale.posix>off ;
|
|
||||||
- }
|
|
||||||
+ properties += <boost.locale.posix>off ;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+
|
|
||||||
if <boost.locale.posix>off in $(properties)
|
|
||||||
{
|
|
||||||
- flags-result += <define>BOOST_LOCALE_NO_POSIX_BACKEND=1 ;
|
|
||||||
+ flags-result += <define>BOOST_LOCALE_NO_POSIX_BACKEND=1 ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
- POSIX_SOURCES =
|
|
||||||
+ POSIX_SOURCES =
|
|
||||||
collate
|
|
||||||
converter
|
|
||||||
numeric
|
|
||||||
@@ -381,12 +381,13 @@ rule configure-full ( properties * : flags-only )
|
|
||||||
{
|
|
||||||
result += <source>util/gregorian.cpp ;
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- if "$(flags-only)" = "flags"
|
|
||||||
+
|
|
||||||
+ if "$(flags-only)" = "flags"
|
|
||||||
{
|
|
||||||
return $(flags-result) ;
|
|
||||||
}
|
|
||||||
- else {
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
result += $(flags-result) ;
|
|
||||||
return $(result) ;
|
|
||||||
}
|
|
||||||
@@ -396,7 +397,6 @@ rule configure ( properties * )
|
|
||||||
{
|
|
||||||
local result = [ configure-full $(properties) : "all" ] ;
|
|
||||||
return $(result) ;
|
|
||||||
-
|
|
||||||
}
|
|
||||||
|
|
||||||
rule configure-flags ( properties * )
|
|
||||||
@@ -404,15 +404,14 @@ rule configure-flags ( properties * )
|
|
||||||
local result ;
|
|
||||||
result = [ configure-full $(properties) : "flags" ] ;
|
|
||||||
return $(result) ;
|
|
||||||
-
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
alias build_options : : : : <conditional>@configure ;
|
|
||||||
alias build_flags : : : : <conditional>@configure-flags ;
|
|
||||||
|
|
||||||
-lib boost_locale
|
|
||||||
- :
|
|
||||||
+lib boost_locale
|
|
||||||
+ :
|
|
||||||
encoding/codepage.cpp
|
|
||||||
shared/date_time.cpp
|
|
||||||
shared/format.cpp
|
|
||||||
@@ -425,7 +424,7 @@ lib boost_locale
|
|
||||||
util/codecvt_converter.cpp
|
|
||||||
util/default_locale.cpp
|
|
||||||
util/info.cpp
|
|
||||||
- util/locale_data.cpp
|
|
||||||
+ util/locale_data.cpp
|
|
||||||
:
|
|
||||||
# Don't link explicitly, not required
|
|
||||||
<define>BOOST_THREAD_NO_LIB=1
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
From 1ff0ead837b32b9415dc840dfef6549e8754b98d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Alexander Grund <Flamefire@users.noreply.github.com>
|
|
||||||
Date: Fri, 10 Dec 2021 17:53:01 +0100
|
|
||||||
Subject: [PATCH] Fix access to first element of empty vector
|
|
||||||
|
|
||||||
Trying to access tmp[0] causes a crash on Fedora when assertion on STL
|
|
||||||
are enabled.
|
|
||||||
|
|
||||||
/usr/include/c++/10/bits/stl_vector.h:1045: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>; std::vector<_Tp, _Alloc>::reference = unsigned char&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.
|
|
||||||
|
|
||||||
Fix is to never have an empty vector as ICU sort keys include the NULL
|
|
||||||
terminator, hence we need at least `length + 1` bytes which means the
|
|
||||||
vector has at least 1 element: The NULL terminator
|
|
||||||
---
|
|
||||||
src/icu/collator.cpp | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/libs/locale/src/icu/collator.cpp b/libs/locale/src/icu/collator.cpp
|
|
||||||
index 7f1ea6ae..79668aa6 100644
|
|
||||||
--- a/libs/locale/src/icu/collator.cpp
|
|
||||||
+++ b/libs/locale/src/icu/collator.cpp
|
|
||||||
@@ -91,9 +91,9 @@ namespace boost {
|
|
||||||
{
|
|
||||||
icu::UnicodeString str=cvt_.icu(b,e);
|
|
||||||
std::vector<uint8_t> tmp;
|
|
||||||
- tmp.resize(str.length());
|
|
||||||
+ tmp.resize(str.length() + 1u);
|
|
||||||
icu::Collator *collate = get_collator(level);
|
|
||||||
- int len = collate->getSortKey(str,&tmp[0],tmp.size());
|
|
||||||
+ const int len = collate->getSortKey(str,&tmp[0],tmp.size());
|
|
||||||
if(len > int(tmp.size())) {
|
|
||||||
tmp.resize(len);
|
|
||||||
collate->getSortKey(str,&tmp[0],tmp.size());
|
|
||||||
@ -1,179 +0,0 @@
|
|||||||
From acb849a8a16499907c554a3c00da201486388459 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Orgad Shaneh <orgads@gmail.com>
|
|
||||||
Date: Thu, 4 Nov 2021 03:39:23 +0200
|
|
||||||
Subject: [PATCH] fix integer overflows in pool::ordered_malloc (#42)
|
|
||||||
|
|
||||||
Fixes trac #6701 (https://svn.boost.org/trac10/ticket/6701).
|
|
||||||
|
|
||||||
Originally-by: Jonathan Wakely <jwakely.boost@kayari.org>
|
|
||||||
---
|
|
||||||
boost/pool/pool.hpp | 31 ++++++++++++++++++++++---------
|
|
||||||
libs/pool/test/Jamfile.v2 | 1 +
|
|
||||||
libs/pool/test/suppressions.txt | 7 +++++++
|
|
||||||
libs/pool/test/test_bug_6701.cpp | 27 +++++++++++++++++++++++++++
|
|
||||||
4 files changed, 57 insertions(+), 9 deletions(-)
|
|
||||||
create mode 100644 libs/pool/test/suppressions.txt
|
|
||||||
create mode 100644 libs/pool/test/test_bug_6701.cpp
|
|
||||||
|
|
||||||
diff --git a/boost/pool/pool.hpp b/boost/pool/pool.hpp
|
|
||||||
index c47b11faf..12728a7ae 100644
|
|
||||||
--- a/boost/pool/pool.hpp
|
|
||||||
+++ b/boost/pool/pool.hpp
|
|
||||||
@@ -26,6 +26,8 @@
|
|
||||||
|
|
||||||
#include <boost/pool/poolfwd.hpp>
|
|
||||||
|
|
||||||
+// std::numeric_limits
|
|
||||||
+#include <boost/limits.hpp>
|
|
||||||
// boost::integer::static_lcm
|
|
||||||
#include <boost/integer/common_factor_ct.hpp>
|
|
||||||
// boost::simple_segregated_storage
|
|
||||||
@@ -355,6 +357,12 @@ class pool: protected simple_segregated_storage < typename UserAllocator::size_t
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ size_type max_chunks() const
|
|
||||||
+ { //! Calculated maximum number of memory chunks that can be allocated in a single call by this Pool.
|
|
||||||
+ size_type POD_size = integer::static_lcm<sizeof(size_type), sizeof(void *)>::value + sizeof(size_type);
|
|
||||||
+ return (std::numeric_limits<size_type>::max() - POD_size) / alloc_size();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
static void * & nextof(void * const ptr)
|
|
||||||
{ //! \returns Pointer dereferenced.
|
|
||||||
//! (Provided and used for the sake of code readability :)
|
|
||||||
@@ -375,6 +383,8 @@ class pool: protected simple_segregated_storage < typename UserAllocator::size_t
|
|
||||||
//! the first time that object needs to allocate system memory.
|
|
||||||
//! The default is 32. This parameter may not be 0.
|
|
||||||
//! \param nmax_size is the maximum number of chunks to allocate in one block.
|
|
||||||
+ set_next_size(nnext_size);
|
|
||||||
+ set_max_size(nmax_size);
|
|
||||||
}
|
|
||||||
|
|
||||||
~pool()
|
|
||||||
@@ -398,8 +408,8 @@ class pool: protected simple_segregated_storage < typename UserAllocator::size_t
|
|
||||||
}
|
|
||||||
void set_next_size(const size_type nnext_size)
|
|
||||||
{ //! Set number of chunks to request from the system the next time that object needs to allocate system memory. This value should never be set to 0.
|
|
||||||
- //! \returns nnext_size.
|
|
||||||
- next_size = start_size = nnext_size;
|
|
||||||
+ BOOST_USING_STD_MIN();
|
|
||||||
+ next_size = start_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(nnext_size, max_chunks());
|
|
||||||
}
|
|
||||||
size_type get_max_size() const
|
|
||||||
{ //! \returns max_size.
|
|
||||||
@@ -407,7 +417,8 @@ class pool: protected simple_segregated_storage < typename UserAllocator::size_t
|
|
||||||
}
|
|
||||||
void set_max_size(const size_type nmax_size)
|
|
||||||
{ //! Set max_size.
|
|
||||||
- max_size = nmax_size;
|
|
||||||
+ BOOST_USING_STD_MIN();
|
|
||||||
+ max_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(nmax_size, max_chunks());
|
|
||||||
}
|
|
||||||
size_type get_requested_size() const
|
|
||||||
{ //! \returns the requested size passed into the constructor.
|
|
||||||
@@ -708,9 +719,9 @@ void * pool<UserAllocator>::malloc_need_resize()
|
|
||||||
|
|
||||||
BOOST_USING_STD_MIN();
|
|
||||||
if(!max_size)
|
|
||||||
- next_size <<= 1;
|
|
||||||
+ set_next_size(next_size << 1);
|
|
||||||
else if( next_size*partition_size/requested_size < max_size)
|
|
||||||
- next_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size*requested_size/ partition_size);
|
|
||||||
+ set_next_size(min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size * requested_size / partition_size));
|
|
||||||
|
|
||||||
// initialize it,
|
|
||||||
store().add_block(node.begin(), node.element_size(), partition_size);
|
|
||||||
@@ -748,9 +759,9 @@ void * pool<UserAllocator>::ordered_malloc_need_resize()
|
|
||||||
|
|
||||||
BOOST_USING_STD_MIN();
|
|
||||||
if(!max_size)
|
|
||||||
- next_size <<= 1;
|
|
||||||
+ set_next_size(next_size << 1);
|
|
||||||
else if( next_size*partition_size/requested_size < max_size)
|
|
||||||
- next_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size*requested_size/ partition_size);
|
|
||||||
+ set_next_size(min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size * requested_size / partition_size));
|
|
||||||
|
|
||||||
// initialize it,
|
|
||||||
// (we can use "add_block" here because we know that
|
|
||||||
@@ -792,6 +803,8 @@ void * pool<UserAllocator>::ordered_malloc(const size_type n)
|
|
||||||
{ //! Gets address of a chunk n, allocating new memory if not already available.
|
|
||||||
//! \returns Address of chunk n if allocated ok.
|
|
||||||
//! \returns 0 if not enough memory for n chunks.
|
|
||||||
+ if (n > max_chunks())
|
|
||||||
+ return 0;
|
|
||||||
|
|
||||||
const size_type partition_size = alloc_size();
|
|
||||||
const size_type total_req_size = n * requested_size;
|
|
||||||
@@ -840,9 +853,9 @@ void * pool<UserAllocator>::ordered_malloc(const size_type n)
|
|
||||||
|
|
||||||
BOOST_USING_STD_MIN();
|
|
||||||
if(!max_size)
|
|
||||||
- next_size <<= 1;
|
|
||||||
+ set_next_size(next_size << 1);
|
|
||||||
else if( next_size*partition_size/requested_size < max_size)
|
|
||||||
- next_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size*requested_size/ partition_size);
|
|
||||||
+ set_next_size(min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size * requested_size / partition_size));
|
|
||||||
|
|
||||||
// insert it into the list,
|
|
||||||
// handle border case.
|
|
||||||
diff --git a/libs/pool/test/Jamfile.v2 b/libs/pool/test/Jamfile.v2
|
|
||||||
index 9e96abcbd..133879a93 100644
|
|
||||||
--- a/libs/pool/test/Jamfile.v2
|
|
||||||
+++ b/libs/pool/test/Jamfile.v2
|
|
||||||
@@ -34,6 +34,7 @@ test-suite pool :
|
|
||||||
<toolset>pathscale:<cxxflags>-Wno-long-long ]
|
|
||||||
[ run test_bug_2696.cpp ]
|
|
||||||
[ run test_bug_5526.cpp ]
|
|
||||||
+ [ run test_bug_6701.cpp ]
|
|
||||||
[ run test_threading.cpp : : : <threading>multi <library>/boost/thread//boost_thread ]
|
|
||||||
[ compile test_poisoned_macros.cpp ]
|
|
||||||
;
|
|
||||||
diff --git a/libs/pool/test/suppressions.txt b/libs/pool/test/suppressions.txt
|
|
||||||
new file mode 100644
|
|
||||||
index 000000000..e30fb813c
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/libs/pool/test/suppressions.txt
|
|
||||||
@@ -0,0 +1,7 @@
|
|
||||||
+{
|
|
||||||
+ no_fishy_value
|
|
||||||
+ Memcheck:FishyValue
|
|
||||||
+ __builtin_vec_new(size)
|
|
||||||
+ fun:_ZnamRKSt9nothrow_t
|
|
||||||
+ ...
|
|
||||||
+}
|
|
||||||
diff --git a/libs/pool/test/test_bug_6701.cpp b/libs/pool/test/test_bug_6701.cpp
|
|
||||||
new file mode 100644
|
|
||||||
index 000000000..e484d3c7e
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/libs/pool/test/test_bug_6701.cpp
|
|
||||||
@@ -0,0 +1,27 @@
|
|
||||||
+/* Copyright (C) 2012 Étienne Dupuis
|
|
||||||
+*
|
|
||||||
+* Use, modification and distribution is subject to the
|
|
||||||
+* Boost Software License, Version 1.0. (See accompanying
|
|
||||||
+* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
+*/
|
|
||||||
+
|
|
||||||
+// Test of bug #6701 (https://svn.boost.org/trac/boost/ticket/6701)
|
|
||||||
+
|
|
||||||
+#include <boost/pool/object_pool.hpp>
|
|
||||||
+#include <boost/limits.hpp>
|
|
||||||
+
|
|
||||||
+int main()
|
|
||||||
+{
|
|
||||||
+ boost::pool<> p(1024, std::numeric_limits<size_t>::max() / 768);
|
|
||||||
+
|
|
||||||
+ void *x = p.malloc();
|
|
||||||
+ BOOST_ASSERT(!x);
|
|
||||||
+
|
|
||||||
+ BOOST_ASSERT(std::numeric_limits<size_t>::max() / 1024 >= p.get_next_size());
|
|
||||||
+ BOOST_ASSERT(std::numeric_limits<size_t>::max() / 1024 >= p.get_max_size());
|
|
||||||
+
|
|
||||||
+ void *y = p.ordered_malloc(std::numeric_limits<size_t>::max() / 768);
|
|
||||||
+ BOOST_ASSERT(!y);
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
--
|
|
||||||
2.33.1
|
|
||||||
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
From 07d7c3b2e0f8c6b269ba167117cd3e549df2f342 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Vinnie Falco <vinnie.falco@gmail.com>
|
|
||||||
Date: Wed, 13 Apr 2022 05:49:05 -0700
|
|
||||||
Subject: [PATCH] array::erase relocates correctly
|
|
||||||
|
|
||||||
fix #692
|
|
||||||
---
|
|
||||||
boost/json/impl/array.ipp | 5 ++++-
|
|
||||||
libs/json/test/array.cpp | 16 ++++++++++++++++
|
|
||||||
2 files changed, 20 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/boost/json/impl/array.ipp b/boost/json/impl/array.ipp
|
|
||||||
index 4d067fb5..a2c7fd6d 100644
|
|
||||||
--- a/boost/json/impl/array.ipp
|
|
||||||
+++ b/boost/json/impl/array.ipp
|
|
||||||
@@ -491,8 +491,11 @@ erase(
|
|
||||||
auto const p = &(*t_)[0] +
|
|
||||||
(pos - &(*t_)[0]);
|
|
||||||
destroy(p, p + 1);
|
|
||||||
- relocate(p, p + 1, 1);
|
|
||||||
--t_->size;
|
|
||||||
+ if(t_->size > 0)
|
|
||||||
+ relocate(p, p + 1,
|
|
||||||
+ t_->size - (p -
|
|
||||||
+ &(*t_)[0]));
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/libs/json/test/array.cpp b/libs/json/test/array.cpp
|
|
||||||
index 1cc87566..4516cc78 100644
|
|
||||||
--- a/libs/json/test/array.cpp
|
|
||||||
+++ b/libs/json/test/array.cpp
|
|
||||||
@@ -1269,6 +1269,21 @@ class array_test
|
|
||||||
array{nullptr, "a", "b"}));
|
|
||||||
}
|
|
||||||
|
|
||||||
+ void
|
|
||||||
+ testIssue692()
|
|
||||||
+ {
|
|
||||||
+ array a;
|
|
||||||
+ object obj;
|
|
||||||
+ obj["test1"] = "hello";
|
|
||||||
+ a.push_back(obj);
|
|
||||||
+ a.push_back(obj);
|
|
||||||
+ a.push_back(obj);
|
|
||||||
+ a.push_back(obj);
|
|
||||||
+ a.push_back(obj);
|
|
||||||
+ while(a.size())
|
|
||||||
+ a.erase(a.begin());
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
void
|
|
||||||
run()
|
|
||||||
{
|
|
||||||
@@ -1283,6 +1298,7 @@ class array_test
|
|
||||||
testExceptions();
|
|
||||||
testEquality();
|
|
||||||
testHash();
|
|
||||||
+ testIssue692();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
26
boost.spec
26
boost.spec
@ -1,8 +1,8 @@
|
|||||||
%global version_enc 1_79_0
|
%global version_enc 1_80_0
|
||||||
|
|
||||||
Name: boost
|
Name: boost
|
||||||
Version: 1.79.0
|
Version: 1.80.0
|
||||||
Release: 3
|
Release: 1
|
||||||
Summary: The free peer-reviewed portable C++ source libraries
|
Summary: The free peer-reviewed portable C++ source libraries
|
||||||
License: BSL-1.0
|
License: BSL-1.0
|
||||||
URL: http://www.boost.org
|
URL: http://www.boost.org
|
||||||
@ -10,17 +10,8 @@ Source0: https://boostorg.jfrog.io/ui/native/main/release/%{version}/sour
|
|||||||
|
|
||||||
# These following patches have been merged into boost develop branch
|
# These following patches have been merged into boost develop branch
|
||||||
# Remove them at the next release
|
# Remove them at the next release
|
||||||
# https://github.com/boostorg/pool/pull/42
|
|
||||||
Patch0: boost-1.78-pool-fix-integer-overflows-in-pool-ordered_malloc.patch
|
|
||||||
# https://github.com/boostorg/locale/pull/72
|
|
||||||
Patch1: boost-1.78-locale-Fix-access-to-first-element-of-empty-vector.patch
|
|
||||||
# https://github.com/boostorg/locale/pull/38
|
|
||||||
Patch2: boost-1.77-locale-remove-linking-with-boost-system.patch
|
|
||||||
# These patches have not been merged yet.
|
|
||||||
# https://github.com/boostorg/python/pull/373
|
# https://github.com/boostorg/python/pull/373
|
||||||
Patch9000: boost-1.78-python-Update-call_method-hpp.patch
|
Patch0: boost-1.78-python-Update-call_method-hpp.patch
|
||||||
# https://github.com/boostorg/json/pull/693
|
|
||||||
Patch9001: boost-1.79-json-array-erase-relocate.patch
|
|
||||||
|
|
||||||
Requires: %{name}-atomic%{?_isa} = %{version}-%{release}
|
Requires: %{name}-atomic%{?_isa} = %{version}-%{release}
|
||||||
Requires: %{name}-chrono%{?_isa} = %{version}-%{release}
|
Requires: %{name}-chrono%{?_isa} = %{version}-%{release}
|
||||||
@ -254,8 +245,6 @@ An implementation of the mandated C99/C++ preprocessor functionality.
|
|||||||
%package devel
|
%package devel
|
||||||
Summary: The Boost C++ headers, shared and static development libraries
|
Summary: The Boost C++ headers, shared and static development libraries
|
||||||
Requires: boost%{?_isa} = %{version}-%{release}
|
Requires: boost%{?_isa} = %{version}-%{release}
|
||||||
Requires: libicu-devel%{?_isa}
|
|
||||||
Requires: libquadmath-devel%{?_isa}
|
|
||||||
Provides: boost-static
|
Provides: boost-static
|
||||||
Obsoletes: boost-static < %{version}
|
Obsoletes: boost-static < %{version}
|
||||||
|
|
||||||
@ -297,8 +286,8 @@ as that on the Boost web page (http://www.boost.org/doc/libs/%{version_enc}).
|
|||||||
install
|
install
|
||||||
|
|
||||||
mkdir boost-doc boost-example
|
mkdir boost-doc boost-example
|
||||||
find libs doc more -regex '.*\.\(html?\|css\|png\|gif\)' -exec cp {} boost-doc --parents \;
|
cp -r index.html boost.png rst.css boost.css doc more boost-doc
|
||||||
cp index.html boost.png rst.css boost.css boost-doc
|
find libs -name doc -exec cp {} boost-doc --parents \;
|
||||||
find libs -name example -exec cp {} boost-example --parents -r \;
|
find libs -name example -exec cp {} boost-example --parents -r \;
|
||||||
|
|
||||||
%files
|
%files
|
||||||
@ -438,6 +427,9 @@ find libs -name example -exec cp {} boost-example --parents -r \;
|
|||||||
%{_libdir}/*.a
|
%{_libdir}/*.a
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Aug 24 2022 Liu Zixian <liuzixian4@huawei.com> - 1.80.0-1
|
||||||
|
- update to 1.80.0
|
||||||
|
|
||||||
* Tue Jun 07 2022 liukuo <liukuo@kylinos.cn> - 1.79.0-3
|
* Tue Jun 07 2022 liukuo <liukuo@kylinos.cn> - 1.79.0-3
|
||||||
- License compliance rectification
|
- License compliance rectification
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user