Compare commits

...

3 Commits
master ... f16

Author SHA1 Message Date
Petr Machata 2f5d4913f6 In Boost.Pool, be careful not to overflow allocated chunk size.
- Resolves: #828857
2012-06-07 01:02:28 +02:00
Denis Arnaud e82ced7d48 Integrated into "upstream" (CMake-ified Boost) the Boost.TR1/Math patch. 2012-01-05 00:00:47 +01:00
Petr Machata eebc669ef4 Build math portion of Boost.TR1, package DSOs in boost-math 2012-01-04 18:26:17 +01:00
8 changed files with 215 additions and 77423 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +0,0 @@
diff -up /home/petr/tmp/blefuj.cc\~ /home/petr/tmp/blefuj.cc
--- boost_1_46_0_beta1/libs/signals/src/named_slot_map.cpp~ 2011-02-03 20:28:07.000000000 +0100
+++ boost_1_46_0_beta1/libs/signals/src/named_slot_map.cpp 2011-02-03 20:51:29.000000000 +0100
@@ -47669,7 +47669,7 @@ void named_slot_map::disconnect(const st
i->first.disconnect();
i = next;
}
- groups.erase(group);
+ groups.erase(const_group_iterator (group));
}
}
@@ -47692,7 +47692,7 @@ void named_slot_map::remove_disconnected
}
// Clear out empty groups
- if (empty(g)) groups.erase(g++);
+ if (empty(g)) groups.erase(const_group_iterator (g++));
else ++g;
}
}
Diff finished. Thu Feb 3 20:51:41 2011

View File

@ -1,59 +0,0 @@
Index: boost/spirit/home/qi/nonterminal/detail/parameterized.hpp
===================================================================
--- boost/spirit/home/qi/nonterminal/detail/parameterized.hpp (revision 68724)
+++ boost/spirit/home/qi/nonterminal/detail/parameterized.hpp (revision 68725)
@@ -14,6 +14,7 @@
#include <boost/ref.hpp>
+#include <boost/spirit/home/support/handles_container.hpp>
#include <boost/spirit/home/qi/parser.hpp>
namespace boost { namespace spirit { namespace qi
@@ -59,4 +60,16 @@ namespace boost { namespace spirit { nam
};
}}}
+namespace boost { namespace spirit { namespace traits
+{
+ ///////////////////////////////////////////////////////////////////////////
+ template <typename Subject, typename Params, typename Attribute
+ , typename Context, typename Iterator>
+ struct handles_container<qi::parameterized_nonterminal<Subject, Params>
+ , Attribute, Context, Iterator>
+ : handles_container<typename remove_const<Subject>::type
+ , Attribute, Context, Iterator>
+ {};
+}}}
+
#endif
Index: boost/spirit/home/karma/nonterminal/detail/parameterized.hpp
===================================================================
--- boost/spirit/home/karma/nonterminal/detail/parameterized.hpp (revision 68724)
+++ boost/spirit/home/karma/nonterminal/detail/parameterized.hpp (revision 68725)
@@ -14,6 +14,7 @@
#include <boost/ref.hpp>
+#include <boost/spirit/home/support/handles_container.hpp>
#include <boost/spirit/home/karma/generator.hpp>
namespace boost { namespace spirit { namespace karma
@@ -60,4 +61,17 @@ namespace boost { namespace spirit { nam
};
}}}
+
+namespace boost { namespace spirit { namespace traits
+{
+ ///////////////////////////////////////////////////////////////////////////
+ template <typename Subject, typename Params, typename Attribute
+ , typename Context, typename Iterator>
+ struct handles_container<karma::parameterized_nonterminal<Subject, Params>
+ , Attribute, Context, Iterator>
+ : handles_container<typename remove_const<Subject>::type
+ , Attribute, Context, Iterator>
+ {};
+}}}
+
#endif

View File

@ -5518,7 +5518,7 @@ index 0000000..7684320
+boost_test_run(tribool_io_test)
diff --git a/libs/math/CMakeLists.txt b/libs/math/CMakeLists.txt
new file mode 100644
index 0000000..0f7652e
index 0000000..84080d5
--- /dev/null
+++ b/libs/math/CMakeLists.txt
@@ -0,0 +1,28 @@
@ -5539,7 +5539,7 @@ index 0000000..0f7652e
+# Add a library target to the build system
+boost_library_project(
+ math
+ # SRCDIRS
+ SRCDIRS src/tr1
+ TESTDIRS test
+ HEADERS ${lib_headers}
+ # DOCDIRS
@ -5558,6 +5558,88 @@ index 0000000..e222098
@@ -0,0 +1 @@
+boost_module(math DEPENDS format array)
\ No newline at end of file
diff --git a/libs/math/src/tr1/CMakeLists.txt b/libs/math/src/tr1/CMakeLists.txt
new file mode 100644
index 0000000..692fa72
--- /dev/null
+++ b/libs/math/src/tr1/CMakeLists.txt
@@ -0,0 +1,76 @@
+boost_add_library(math_tr1
+
+ assoc_laguerre.cpp assoc_legendre.cpp beta.cpp
+ comp_ellint_1.cpp comp_ellint_2.cpp comp_ellint_3.cpp
+ cyl_bessel_i.cpp cyl_bessel_j.cpp cyl_bessel_k.cpp
+ cyl_neumann.cpp ellint_1.cpp ellint_2.cpp ellint_3.cpp
+ expint.cpp hermite.cpp laguerre.cpp legendre.cpp
+ riemann_zeta.cpp sph_bessel.cpp sph_legendre.cpp
+ sph_neumann.cpp
+
+ SHARED_COMPILE_FLAGS "-DBOOST_MATH_TR1_DYN_LINK=1"
+ COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}"
+)
+
+boost_add_library(math_tr1f
+
+ assoc_laguerref.cpp assoc_legendref.cpp betaf.cpp
+ comp_ellint_1f.cpp comp_ellint_2f.cpp comp_ellint_3f.cpp
+ cyl_bessel_if.cpp cyl_bessel_jf.cpp cyl_bessel_kf.cpp
+ cyl_neumannf.cpp ellint_1f.cpp ellint_2f.cpp ellint_3f.cpp
+ expintf.cpp hermitef.cpp laguerref.cpp legendref.cpp
+ riemann_zetaf.cpp sph_besself.cpp sph_legendref.cpp
+ sph_neumannf.cpp
+
+ SHARED_COMPILE_FLAGS "-DBOOST_MATH_TR1_DYN_LINK=1"
+ COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}"
+)
+
+boost_add_library(math_tr1l
+
+ assoc_laguerrel.cpp assoc_legendrel.cpp betal.cpp
+ comp_ellint_1l.cpp comp_ellint_2l.cpp comp_ellint_3l.cpp
+ cyl_bessel_il.cpp cyl_bessel_jl.cpp cyl_bessel_kl.cpp
+ cyl_neumannl.cpp ellint_1l.cpp ellint_2l.cpp ellint_3l.cpp
+ expintl.cpp hermitel.cpp laguerrel.cpp legendrel.cpp
+ riemann_zetal.cpp sph_bessell.cpp sph_legendrel.cpp
+ sph_neumannl.cpp
+
+ SHARED_COMPILE_FLAGS "-DBOOST_MATH_TR1_DYN_LINK=1"
+ COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}"
+)
+
+boost_add_library(math_c99
+
+ acosh.cpp asinh.cpp atanh.cpp cbrt.cpp copysign.cpp erfc.cpp
+ erf.cpp expm1.cpp fmax.cpp fmin.cpp fpclassify.cpp hypot.cpp
+ lgamma.cpp llround.cpp log1p.cpp lround.cpp nextafter.cpp
+ nexttoward.cpp round.cpp tgamma.cpp trunc.cpp
+
+ SHARED_COMPILE_FLAGS "-DBOOST_MATH_TR1_DYN_LINK=1"
+ COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}"
+)
+
+boost_add_library(math_c99f
+
+ acoshf.cpp asinhf.cpp atanhf.cpp cbrtf.cpp copysignf.cpp
+ erfcf.cpp erff.cpp expm1f.cpp fmaxf.cpp fminf.cpp
+ fpclassifyf.cpp hypotf.cpp lgammaf.cpp llroundf.cpp log1pf.cpp
+ lroundf.cpp nextafterf.cpp nexttowardf.cpp roundf.cpp
+ tgammaf.cpp truncf.cpp
+
+ SHARED_COMPILE_FLAGS "-DBOOST_MATH_TR1_DYN_LINK=1"
+ COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}"
+)
+
+boost_add_library(math_c99l
+
+ acoshl.cpp asinhl.cpp atanhl.cpp cbrtl.cpp copysignl.cpp
+ erfcl.cpp erfl.cpp expm1l.cpp fmaxl.cpp fminl.cpp
+ fpclassifyl.cpp hypotl.cpp lgammal.cpp llroundl.cpp log1pl.cpp
+ lroundl.cpp nextafterl.cpp nexttowardl.cpp roundl.cpp
+ tgammal.cpp truncl.cpp
+
+ SHARED_COMPILE_FLAGS "-DBOOST_MATH_TR1_DYN_LINK=1"
+ COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}"
+)
diff --git a/libs/math/test/CMakeLists.txt b/libs/math/test/CMakeLists.txt
new file mode 100644
index 0000000..88f26b7
@ -11473,24 +11555,6 @@ index 0000000..8c435b7
+ RELEASE
+ STATIC
+ )
diff --git a/tools/build/CMake/.gitignore b/tools/build/CMake/.gitignore
new file mode 100644
index 0000000..5b99088
--- /dev/null
+++ b/tools/build/CMake/.gitignore
@@ -0,0 +1,12 @@
+/build
+tmp
+*.pyc
+._*
+bjam
+project-config.jam
+bin.v2/
+dist/
+.\#*
+*.tar.*
+*.zip
+
diff --git a/tools/build/CMake/Boost.bmp b/tools/build/CMake/Boost.bmp
new file mode 100644
index 0000000..944ab5e
@ -14992,16 +15056,6 @@ index 0000000..75bc4f1
+ <rewriteURI uriStartString="http://docbook.sourceforge.net/release/xsl/current/" rewritePrefix="file://@DOCBOOK_XSL_DIR@/"/>
+ <rewriteURI uriStartString="http://www.oasis-open.org/docbook/xml/4.2/" rewritePrefix="file://@DOCBOOK_DTD_DIR@/"/>
+</catalog>
diff --git a/tools/build/CMake/docs/.gitignore b/tools/build/CMake/docs/.gitignore
new file mode 100644
index 0000000..7f67dd3
--- /dev/null
+++ b/tools/build/CMake/docs/.gitignore
@@ -0,0 +1,4 @@
+build/doctrees
+build/latex
+Makefile
+
diff --git a/tools/build/CMake/docs/Makefile.in b/tools/build/CMake/docs/Makefile.in
new file mode 100644
index 0000000..e51563a
@ -29958,13 +30012,6 @@ index 0000000..3a98b89
+ </body>
+</html>
\ No newline at end of file
diff --git a/tools/build/CMake/docs/source/.gitignore b/tools/build/CMake/docs/source/.gitignore
new file mode 100644
index 0000000..4ba4af7
--- /dev/null
+++ b/tools/build/CMake/docs/source/.gitignore
@@ -0,0 +1 @@
+boost_cmake_version.py
diff --git a/tools/build/CMake/docs/source/GitLexer.py b/tools/build/CMake/docs/source/GitLexer.py
new file mode 100644
index 0000000..20a672e
@ -37316,13 +37363,6 @@ index 0000000..341ecf8
+boost_external_report(ZLib INCLUDE_DIR LIBRARIES)
+
+
diff --git a/tools/build/CMake/install_me/.gitignore b/tools/build/CMake/install_me/.gitignore
new file mode 100644
index 0000000..211686a
--- /dev/null
+++ b/tools/build/CMake/install_me/.gitignore
@@ -0,0 +1 @@
+*.cmake
diff --git a/tools/build/CMake/install_me/Boost-thisversion.cmake.in b/tools/build/CMake/install_me/Boost-thisversion.cmake.in
new file mode 100644
index 0000000..b292097

110
boost-1.47.0-pool.patch Normal file
View File

@ -0,0 +1,110 @@
diff -up boost_1_47_0/boost/pool/pool.hpp\~ boost_1_47_0/boost/pool/pool.hpp
--- boost_1_47_0/boost/pool/pool.hpp~ 2011-01-11 15:22:32.000000000 +0100
+++ boost_1_47_0/boost/pool/pool.hpp 2012-06-07 01:00:26.936184589 +0200
@@ -26,6 +26,10 @@
#include <boost/pool/poolfwd.hpp>
+// std::numeric_limits
+#include <boost/limits.hpp>
+// boost::math::static_lcm
+#include <boost/math/common_factor.hpp>
// boost::details::pool::ct_lcm
#include <boost/pool/detail/ct_gcd_lcm.hpp>
// boost::details::pool::lcm
@@ -187,6 +191,15 @@ class pool: protected simple_segregated_
return details::pool::lcm<size_type>(requested_size, min_size);
}
+ size_type max_chunks() const
+ { //! Calculated maximum number of memory chunks that can be allocated in a single call by this Pool.
+ size_type partition_size = alloc_size();
+ size_type POD_size = math::static_lcm<sizeof(size_type), sizeof(void *)>::value + sizeof(size_type);
+ size_type max_chunks = (std::numeric_limits<size_type>::max() - POD_size) / alloc_size();
+
+ return max_chunks;
+ }
+
// for the sake of code readability :)
static void * & nextof(void * const ptr)
{ return *(static_cast<void **>(ptr)); }
@@ -198,7 +211,10 @@ class pool: protected simple_segregated_
const size_type nnext_size = 32,
const size_type nmax_size = 0)
:list(0, 0), requested_size(nrequested_size), next_size(nnext_size), start_size(nnext_size),max_size(nmax_size)
- { }
+ {
+ set_next_size(nnext_size);
+ set_max_size(nmax_size);
+ }
~pool() { purge_memory(); }
@@ -213,9 +229,17 @@ class pool: protected simple_segregated_
// These functions are extensions!
size_type get_next_size() const { return next_size; }
- void set_next_size(const size_type nnext_size) { next_size = start_size = nnext_size; }
+ void set_next_size(const size_type 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 { return max_size; }
- void set_max_size(const size_type nmax_size) { max_size = nmax_size; }
+ void set_max_size(const size_type nmax_size)
+ {
+ BOOST_USING_STD_MIN();
+ max_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(nmax_size, max_chunks());
+ }
size_type get_requested_size() const { return requested_size; }
// Both malloc and ordered_malloc do a quick inlined check first for any
@@ -447,9 +471,9 @@ void * pool<UserAllocator>::malloc_need_
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);
@@ -476,9 +500,9 @@ void * pool<UserAllocator>::ordered_mall
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
@@ -519,6 +543,9 @@ void * pool<UserAllocator>::ordered_mall
template <typename UserAllocator>
void * pool<UserAllocator>::ordered_malloc(const size_type n)
{
+ if (n > max_chunks())
+ return 0;
+
const size_type partition_size = alloc_size();
const size_type total_req_size = n * requested_size;
const size_type num_chunks = total_req_size / partition_size +
@@ -549,9 +576,9 @@ void * pool<UserAllocator>::ordered_mall
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 finished. Thu Jun 7 01:00:38 2012

View File

@ -28,7 +28,7 @@ Name: boost
Summary: The free peer-reviewed portable C++ source libraries
Version: 1.47.0
%define version_enc 1_47_0
Release: 4%{?dist}
Release: 7%{?dist}
License: Boost
# The CMake build framework (set of CMakeLists.txt and module.cmake files) is
@ -98,6 +98,10 @@ Patch3: boost-1.47.0-exceptions.patch
# https://svn.boost.org/trac/boost/ticket/5934
Patch4: boost-1.47.0-tuple.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=828856
# https://bugzilla.redhat.com/show_bug.cgi?id=828857
Patch5: boost-1.47.0-pool.patch
%bcond_with tests
%bcond_with docs_generated
@ -157,15 +161,13 @@ Run-Time support for Boost.IOStreams, a framework for defining streams,
stream buffers and i/o filters.
%package math
Summary: Stub that used to contain boost math library
Summary: Math functions for boost TR1 library
Group: System Environment/Libraries
%description math
This package is a stub that used to contain run-time component of boost
math library. Now that boost math library is header-only, this
package is empty. It's kept around only so that during yum-assisted
update, old libraries from boost-math package aren't left around.
Run-Time support for C99 and C++ TR1 C-style Functions from math
portion of Boost.TR1.
%package program-options
Summary: Run-Time component of boost program_options library
@ -443,6 +445,7 @@ sed 's/_FEDORA_SONAME/%{sonamever}/' %{PATCH1} | %{__patch} -p0 --fuzz=0
%patch2 -p1
%patch3 -p0
%patch4 -p2
%patch5 -p1
%build
# Support for building tests.
@ -752,6 +755,7 @@ find $RPM_BUILD_ROOT%{_includedir}/ \( -name '*.pl' -o -name '*.sh' \) -exec %{_
%files math
%defattr(-, root, root, -)
%doc LICENSE_1_0.txt
%{_libdir}/libboost_math*.so.%{sonamever}
%files test
%defattr(-, root, root, -)
@ -895,6 +899,17 @@ find $RPM_BUILD_ROOT%{_includedir}/ \( -name '*.pl' -o -name '*.sh' \) -exec %{_
%{_bindir}/bjam
%changelog
* Wed Jun 6 2012 Petr Machata <pmachata@redhat.com> - 1.47.0-7
- In Boost.Pool, be careful not to overflow allocated chunk size.
- Resolves: #828857
* Wed Jan 4 2012 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 1.47.0-6
- Integrated into "upstream" (CMake-ified Boost) the Boost.TR1/Math patch.
* Wed Jan 4 2012 Petr Machata <pmachata@redhat.com> - 1.47.0-5
- Build math portion of Boost.TR1, package DSOs in boost-math.
- Resolves: #771370
* Thu Nov 3 2011 Petr Machata <pmachata@redhat.com> - 1.47.0-4
- Use <boost/tr1/tuple> instead of C++11 header <tuple> in boost math.
- Resolves: #751210