Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2008-01-21 15:16:26


Author: danieljames
Date: 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
New Revision: 42905
URL: http://svn.boost.org/trac/boost/changeset/42905

Log:
Merge.
Added:
   branches/fix-links/boost/accumulators/
      - copied from r42899, /trunk/boost/accumulators/
   branches/fix-links/boost/accumulators/accumulators.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/accumulators.hpp
   branches/fix-links/boost/accumulators/accumulators_fwd.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/accumulators_fwd.hpp
   branches/fix-links/boost/accumulators/framework/
      - copied from r42899, /trunk/boost/accumulators/framework/
   branches/fix-links/boost/accumulators/framework/accumulator_base.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/framework/accumulator_base.hpp
   branches/fix-links/boost/accumulators/framework/accumulator_concept.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/framework/accumulator_concept.hpp
   branches/fix-links/boost/accumulators/framework/accumulator_set.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/framework/accumulator_set.hpp
   branches/fix-links/boost/accumulators/framework/accumulators/
      - copied from r42899, /trunk/boost/accumulators/framework/accumulators/
   branches/fix-links/boost/accumulators/framework/accumulators/droppable_accumulator.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/framework/accumulators/droppable_accumulator.hpp
   branches/fix-links/boost/accumulators/framework/accumulators/external_accumulator.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/framework/accumulators/external_accumulator.hpp
   branches/fix-links/boost/accumulators/framework/accumulators/reference_accumulator.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/framework/accumulators/reference_accumulator.hpp
   branches/fix-links/boost/accumulators/framework/accumulators/value_accumulator.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/framework/accumulators/value_accumulator.hpp
   branches/fix-links/boost/accumulators/framework/depends_on.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/framework/depends_on.hpp
   branches/fix-links/boost/accumulators/framework/external.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/framework/external.hpp
   branches/fix-links/boost/accumulators/framework/extractor.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/framework/extractor.hpp
   branches/fix-links/boost/accumulators/framework/features.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/framework/features.hpp
   branches/fix-links/boost/accumulators/framework/parameters/
      - copied from r42899, /trunk/boost/accumulators/framework/parameters/
   branches/fix-links/boost/accumulators/framework/parameters/accumulator.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/framework/parameters/accumulator.hpp
   branches/fix-links/boost/accumulators/framework/parameters/sample.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/framework/parameters/sample.hpp
   branches/fix-links/boost/accumulators/framework/parameters/weight.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/framework/parameters/weight.hpp
   branches/fix-links/boost/accumulators/framework/parameters/weights.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/framework/parameters/weights.hpp
   branches/fix-links/boost/accumulators/numeric/
      - copied from r42899, /trunk/boost/accumulators/numeric/
   branches/fix-links/boost/accumulators/numeric/detail/
      - copied from r42899, /trunk/boost/accumulators/numeric/detail/
   branches/fix-links/boost/accumulators/numeric/detail/function1.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/numeric/detail/function1.hpp
   branches/fix-links/boost/accumulators/numeric/detail/function2.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/numeric/detail/function2.hpp
   branches/fix-links/boost/accumulators/numeric/detail/function3.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/numeric/detail/function3.hpp
   branches/fix-links/boost/accumulators/numeric/detail/function4.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/numeric/detail/function4.hpp
   branches/fix-links/boost/accumulators/numeric/detail/function_n.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/numeric/detail/function_n.hpp
   branches/fix-links/boost/accumulators/numeric/detail/pod_singleton.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/numeric/detail/pod_singleton.hpp
   branches/fix-links/boost/accumulators/numeric/functional/
      - copied from r42899, /trunk/boost/accumulators/numeric/functional/
   branches/fix-links/boost/accumulators/numeric/functional.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/numeric/functional.hpp
   branches/fix-links/boost/accumulators/numeric/functional/complex.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/numeric/functional/complex.hpp
   branches/fix-links/boost/accumulators/numeric/functional/valarray.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/numeric/functional/valarray.hpp
   branches/fix-links/boost/accumulators/numeric/functional/vector.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/numeric/functional/vector.hpp
   branches/fix-links/boost/accumulators/numeric/functional_fwd.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/numeric/functional_fwd.hpp
   branches/fix-links/boost/accumulators/statistics/
      - copied from r42899, /trunk/boost/accumulators/statistics/
   branches/fix-links/boost/accumulators/statistics.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics.hpp
   branches/fix-links/boost/accumulators/statistics/count.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/count.hpp
   branches/fix-links/boost/accumulators/statistics/covariance.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/covariance.hpp
   branches/fix-links/boost/accumulators/statistics/density.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/density.hpp
   branches/fix-links/boost/accumulators/statistics/error_of.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/error_of.hpp
   branches/fix-links/boost/accumulators/statistics/error_of_mean.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/error_of_mean.hpp
   branches/fix-links/boost/accumulators/statistics/extended_p_square.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/extended_p_square.hpp
   branches/fix-links/boost/accumulators/statistics/extended_p_square_quantile.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/extended_p_square_quantile.hpp
   branches/fix-links/boost/accumulators/statistics/kurtosis.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/kurtosis.hpp
   branches/fix-links/boost/accumulators/statistics/max.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/max.hpp
   branches/fix-links/boost/accumulators/statistics/mean.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/mean.hpp
   branches/fix-links/boost/accumulators/statistics/median.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/median.hpp
   branches/fix-links/boost/accumulators/statistics/min.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/min.hpp
   branches/fix-links/boost/accumulators/statistics/moment.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/moment.hpp
   branches/fix-links/boost/accumulators/statistics/p_square_cumulative_distribution.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/p_square_cumulative_distribution.hpp
   branches/fix-links/boost/accumulators/statistics/p_square_quantile.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/p_square_quantile.hpp
   branches/fix-links/boost/accumulators/statistics/parameters/
      - copied from r42899, /trunk/boost/accumulators/statistics/parameters/
   branches/fix-links/boost/accumulators/statistics/parameters/quantile_probability.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/parameters/quantile_probability.hpp
   branches/fix-links/boost/accumulators/statistics/peaks_over_threshold.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/peaks_over_threshold.hpp
   branches/fix-links/boost/accumulators/statistics/pot_quantile.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/pot_quantile.hpp
   branches/fix-links/boost/accumulators/statistics/pot_tail_mean.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/pot_tail_mean.hpp
   branches/fix-links/boost/accumulators/statistics/skewness.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/skewness.hpp
   branches/fix-links/boost/accumulators/statistics/stats.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/stats.hpp
   branches/fix-links/boost/accumulators/statistics/sum.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/sum.hpp
   branches/fix-links/boost/accumulators/statistics/tail.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/tail.hpp
   branches/fix-links/boost/accumulators/statistics/tail_mean.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/tail_mean.hpp
   branches/fix-links/boost/accumulators/statistics/tail_quantile.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/tail_quantile.hpp
   branches/fix-links/boost/accumulators/statistics/tail_variate.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/tail_variate.hpp
   branches/fix-links/boost/accumulators/statistics/tail_variate_means.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/tail_variate_means.hpp
   branches/fix-links/boost/accumulators/statistics/times2_iterator.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/times2_iterator.hpp
   branches/fix-links/boost/accumulators/statistics/variance.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/variance.hpp
   branches/fix-links/boost/accumulators/statistics/variates/
      - copied from r42899, /trunk/boost/accumulators/statistics/variates/
   branches/fix-links/boost/accumulators/statistics/variates/covariate.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/variates/covariate.hpp
   branches/fix-links/boost/accumulators/statistics/weighted_covariance.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/weighted_covariance.hpp
   branches/fix-links/boost/accumulators/statistics/weighted_density.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/weighted_density.hpp
   branches/fix-links/boost/accumulators/statistics/weighted_extended_p_square.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/weighted_extended_p_square.hpp
   branches/fix-links/boost/accumulators/statistics/weighted_kurtosis.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/weighted_kurtosis.hpp
   branches/fix-links/boost/accumulators/statistics/weighted_mean.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/weighted_mean.hpp
   branches/fix-links/boost/accumulators/statistics/weighted_median.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/weighted_median.hpp
   branches/fix-links/boost/accumulators/statistics/weighted_moment.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/weighted_moment.hpp
   branches/fix-links/boost/accumulators/statistics/weighted_p_square_cumulative_distribution.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/weighted_p_square_cumulative_distribution.hpp
   branches/fix-links/boost/accumulators/statistics/weighted_p_square_quantile.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/weighted_p_square_quantile.hpp
   branches/fix-links/boost/accumulators/statistics/weighted_peaks_over_threshold.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/weighted_peaks_over_threshold.hpp
   branches/fix-links/boost/accumulators/statistics/weighted_skewness.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/weighted_skewness.hpp
   branches/fix-links/boost/accumulators/statistics/weighted_sum.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/weighted_sum.hpp
   branches/fix-links/boost/accumulators/statistics/weighted_tail_mean.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/weighted_tail_mean.hpp
   branches/fix-links/boost/accumulators/statistics/weighted_tail_quantile.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/weighted_tail_quantile.hpp
   branches/fix-links/boost/accumulators/statistics/weighted_tail_variate_means.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/weighted_tail_variate_means.hpp
   branches/fix-links/boost/accumulators/statistics/weighted_variance.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/weighted_variance.hpp
   branches/fix-links/boost/accumulators/statistics/with_error.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics/with_error.hpp
   branches/fix-links/boost/accumulators/statistics_fwd.hpp
      - copied unchanged from r42899, /trunk/boost/accumulators/statistics_fwd.hpp
   branches/fix-links/boost/interprocess/allocators/detail/allocator_common.hpp
      - copied unchanged from r42899, /trunk/boost/interprocess/allocators/detail/allocator_common.hpp
   branches/fix-links/boost/intrusive/linear_slist_algorithms.hpp
      - copied unchanged from r42899, /trunk/boost/intrusive/linear_slist_algorithms.hpp
   branches/fix-links/boost/iostreams/detail/config/fpos.hpp
      - copied unchanged from r42899, /trunk/boost/iostreams/detail/config/fpos.hpp
   branches/fix-links/boost/iostreams/detail/config/rtl.hpp
      - copied unchanged from r42899, /trunk/boost/iostreams/detail/config/rtl.hpp
   branches/fix-links/boost/iostreams/detail/restrict_impl.hpp
      - copied unchanged from r42899, /trunk/boost/iostreams/detail/restrict_impl.hpp
   branches/fix-links/boost/iostreams/slice.hpp
      - copied unchanged from r42899, /trunk/boost/iostreams/slice.hpp
   branches/fix-links/boost/mpi/detail/binary_buffer_iprimitive.hpp
      - copied unchanged from r42899, /trunk/boost/mpi/detail/binary_buffer_iprimitive.hpp
   branches/fix-links/boost/mpi/detail/binary_buffer_oprimitive.hpp
      - copied unchanged from r42899, /trunk/boost/mpi/detail/binary_buffer_oprimitive.hpp
   branches/fix-links/boost/statechart/detail/reaction_dispatcher.hpp
      - copied unchanged from r42899, /trunk/boost/statechart/detail/reaction_dispatcher.hpp
   branches/fix-links/boost/unordered/
      - copied from r42899, /trunk/boost/unordered/
   branches/fix-links/boost/unordered/detail/
      - copied from r42899, /trunk/boost/unordered/detail/
   branches/fix-links/boost/unordered/detail/allocator.hpp
      - copied unchanged from r42899, /trunk/boost/unordered/detail/allocator.hpp
   branches/fix-links/boost/unordered/detail/hash_table.hpp
      - copied unchanged from r42899, /trunk/boost/unordered/detail/hash_table.hpp
   branches/fix-links/boost/unordered/detail/hash_table_impl.hpp
      - copied unchanged from r42899, /trunk/boost/unordered/detail/hash_table_impl.hpp
   branches/fix-links/boost/unordered_map.hpp
      - copied unchanged from r42899, /trunk/boost/unordered_map.hpp
   branches/fix-links/boost/unordered_set.hpp
      - copied unchanged from r42899, /trunk/boost/unordered_set.hpp
   branches/fix-links/boost/xpressive/proto/detail/as_lvalue.hpp
      - copied unchanged from r42899, /trunk/boost/xpressive/proto/detail/as_lvalue.hpp
   branches/fix-links/boost/xpressive/proto/detail/dont_care.hpp
      - copied unchanged from r42899, /trunk/boost/xpressive/proto/detail/dont_care.hpp
   branches/fix-links/boost/xpressive/proto/transform/bind.hpp
      - copied unchanged from r42899, /trunk/boost/xpressive/proto/transform/bind.hpp
   branches/fix-links/boost/xpressive/proto/transform/call.hpp
      - copied unchanged from r42899, /trunk/boost/xpressive/proto/transform/call.hpp
   branches/fix-links/boost/xpressive/proto/transform/make.hpp
      - copied unchanged from r42899, /trunk/boost/xpressive/proto/transform/make.hpp
   branches/fix-links/boost/xpressive/proto/transform/when.hpp
      - copied unchanged from r42899, /trunk/boost/xpressive/proto/transform/when.hpp
   branches/fix-links/doc/html/unordered.html
      - copied unchanged from r42899, /trunk/doc/html/unordered.html
   branches/fix-links/libs/accumulators/
      - copied from r42899, /trunk/libs/accumulators/
   branches/fix-links/libs/accumulators/doc/
      - copied from r42899, /trunk/libs/accumulators/doc/
   branches/fix-links/libs/accumulators/doc/Jamfile.v2
      - copied unchanged from r42899, /trunk/libs/accumulators/doc/Jamfile.v2
   branches/fix-links/libs/accumulators/doc/accumulators.qbk
      - copied unchanged from r42899, /trunk/libs/accumulators/doc/accumulators.qbk
   branches/fix-links/libs/accumulators/example/
      - copied from r42899, /trunk/libs/accumulators/example/
   branches/fix-links/libs/accumulators/example/Jamfile.v2
      - copied unchanged from r42899, /trunk/libs/accumulators/example/Jamfile.v2
   branches/fix-links/libs/accumulators/example/example.vcproj
      - copied unchanged from r42899, /trunk/libs/accumulators/example/example.vcproj
   branches/fix-links/libs/accumulators/example/main.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/example/main.cpp
   branches/fix-links/libs/accumulators/index.html
      - copied unchanged from r42899, /trunk/libs/accumulators/index.html
   branches/fix-links/libs/accumulators/test/
      - copied from r42899, /trunk/libs/accumulators/test/
   branches/fix-links/libs/accumulators/test/Jamfile.v2
      - copied unchanged from r42899, /trunk/libs/accumulators/test/Jamfile.v2
   branches/fix-links/libs/accumulators/test/count.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/count.cpp
   branches/fix-links/libs/accumulators/test/covariance.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/covariance.cpp
   branches/fix-links/libs/accumulators/test/droppable.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/droppable.cpp
   branches/fix-links/libs/accumulators/test/error_of.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/error_of.cpp
   branches/fix-links/libs/accumulators/test/extended_p_square.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/extended_p_square.cpp
   branches/fix-links/libs/accumulators/test/extended_p_square_quantile.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/extended_p_square_quantile.cpp
   branches/fix-links/libs/accumulators/test/external_accumulator.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/external_accumulator.cpp
   branches/fix-links/libs/accumulators/test/external_weights.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/external_weights.cpp
   branches/fix-links/libs/accumulators/test/kurtosis.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/kurtosis.cpp
   branches/fix-links/libs/accumulators/test/max.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/max.cpp
   branches/fix-links/libs/accumulators/test/mean.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/mean.cpp
   branches/fix-links/libs/accumulators/test/median.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/median.cpp
   branches/fix-links/libs/accumulators/test/min.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/min.cpp
   branches/fix-links/libs/accumulators/test/moment.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/moment.cpp
   branches/fix-links/libs/accumulators/test/p_square_cumulative_distribution.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/p_square_cumulative_distribution.cpp
   branches/fix-links/libs/accumulators/test/p_square_quantile.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/p_square_quantile.cpp
   branches/fix-links/libs/accumulators/test/p_square_quantile_extended.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/p_square_quantile_extended.cpp
   branches/fix-links/libs/accumulators/test/pot_quantile.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/pot_quantile.cpp
   branches/fix-links/libs/accumulators/test/reference.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/reference.cpp
   branches/fix-links/libs/accumulators/test/skewness.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/skewness.cpp
   branches/fix-links/libs/accumulators/test/sum.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/sum.cpp
   branches/fix-links/libs/accumulators/test/tail.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/tail.cpp
   branches/fix-links/libs/accumulators/test/tail_mean.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/tail_mean.cpp
   branches/fix-links/libs/accumulators/test/tail_quantile.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/tail_quantile.cpp
   branches/fix-links/libs/accumulators/test/tail_variate_means.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/tail_variate_means.cpp
   branches/fix-links/libs/accumulators/test/valarray.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/valarray.cpp
   branches/fix-links/libs/accumulators/test/value.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/value.cpp
   branches/fix-links/libs/accumulators/test/variance.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/variance.cpp
   branches/fix-links/libs/accumulators/test/vector.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/vector.cpp
   branches/fix-links/libs/accumulators/test/weighted_covariance.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/weighted_covariance.cpp
   branches/fix-links/libs/accumulators/test/weighted_extended_p_square.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/weighted_extended_p_square.cpp
   branches/fix-links/libs/accumulators/test/weighted_kurtosis.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/weighted_kurtosis.cpp
   branches/fix-links/libs/accumulators/test/weighted_mean.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/weighted_mean.cpp
   branches/fix-links/libs/accumulators/test/weighted_median.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/weighted_median.cpp
   branches/fix-links/libs/accumulators/test/weighted_moment.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/weighted_moment.cpp
   branches/fix-links/libs/accumulators/test/weighted_p_square_cum_dist.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/weighted_p_square_cum_dist.cpp
   branches/fix-links/libs/accumulators/test/weighted_p_square_quantile.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/weighted_p_square_quantile.cpp
   branches/fix-links/libs/accumulators/test/weighted_pot_quantile.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/weighted_pot_quantile.cpp
   branches/fix-links/libs/accumulators/test/weighted_skewness.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/weighted_skewness.cpp
   branches/fix-links/libs/accumulators/test/weighted_sum.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/weighted_sum.cpp
   branches/fix-links/libs/accumulators/test/weighted_tail_mean.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/weighted_tail_mean.cpp
   branches/fix-links/libs/accumulators/test/weighted_tail_quantile.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/weighted_tail_quantile.cpp
   branches/fix-links/libs/accumulators/test/weighted_tail_variate_means.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/weighted_tail_variate_means.cpp
   branches/fix-links/libs/accumulators/test/weighted_variance.cpp
      - copied unchanged from r42899, /trunk/libs/accumulators/test/weighted_variance.cpp
   branches/fix-links/libs/interprocess/test/vector_test.hpp
      - copied unchanged from r42899, /trunk/libs/interprocess/test/vector_test.hpp
   branches/fix-links/libs/iostreams/test/combine_test.cpp
      - copied unchanged from r42899, /trunk/libs/iostreams/test/combine_test.cpp
   branches/fix-links/libs/iostreams/test/large_file_test.cpp
      - copied unchanged from r42899, /trunk/libs/iostreams/test/large_file_test.cpp
   branches/fix-links/libs/iostreams/test/slice_test.cpp
      - copied unchanged from r42899, /trunk/libs/iostreams/test/slice_test.cpp
   branches/fix-links/libs/unordered/
      - copied from r42899, /trunk/libs/unordered/
   branches/fix-links/libs/unordered/doc/
      - copied from r42899, /trunk/libs/unordered/doc/
   branches/fix-links/libs/unordered/doc/Jamfile.v2
      - copied unchanged from r42899, /trunk/libs/unordered/doc/Jamfile.v2
   branches/fix-links/libs/unordered/doc/buckets.qbk
      - copied unchanged from r42899, /trunk/libs/unordered/doc/buckets.qbk
   branches/fix-links/libs/unordered/doc/comparison.qbk
      - copied unchanged from r42899, /trunk/libs/unordered/doc/comparison.qbk
   branches/fix-links/libs/unordered/doc/diagrams/
      - copied from r42899, /trunk/libs/unordered/doc/diagrams/
   branches/fix-links/libs/unordered/doc/diagrams/buckets.dia
      - copied unchanged from r42899, /trunk/libs/unordered/doc/diagrams/buckets.dia
   branches/fix-links/libs/unordered/doc/diagrams/buckets.png
      - copied unchanged from r42899, /trunk/libs/unordered/doc/diagrams/buckets.png
   branches/fix-links/libs/unordered/doc/hash_equality.qbk
      - copied unchanged from r42899, /trunk/libs/unordered/doc/hash_equality.qbk
   branches/fix-links/libs/unordered/doc/intro.qbk
      - copied unchanged from r42899, /trunk/libs/unordered/doc/intro.qbk
   branches/fix-links/libs/unordered/doc/rationale.qbk
      - copied unchanged from r42899, /trunk/libs/unordered/doc/rationale.qbk
   branches/fix-links/libs/unordered/doc/ref.xml
      - copied unchanged from r42899, /trunk/libs/unordered/doc/ref.xml
   branches/fix-links/libs/unordered/doc/src_code/
      - copied from r42899, /trunk/libs/unordered/doc/src_code/
   branches/fix-links/libs/unordered/doc/src_code/insensitive.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/doc/src_code/insensitive.cpp
   branches/fix-links/libs/unordered/doc/src_code/point1.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/doc/src_code/point1.cpp
   branches/fix-links/libs/unordered/doc/src_code/point2.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/doc/src_code/point2.cpp
   branches/fix-links/libs/unordered/doc/unordered.qbk
      - copied unchanged from r42899, /trunk/libs/unordered/doc/unordered.qbk
   branches/fix-links/libs/unordered/examples/
      - copied from r42899, /trunk/libs/unordered/examples/
   branches/fix-links/libs/unordered/examples/case_insensitive.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/examples/case_insensitive.hpp
   branches/fix-links/libs/unordered/examples/case_insensitive_test.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/examples/case_insensitive_test.cpp
   branches/fix-links/libs/unordered/examples/hash_functions/
      - copied from r42899, /trunk/libs/unordered/examples/hash_functions/
   branches/fix-links/libs/unordered/examples/hash_functions/fnv-1.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/examples/hash_functions/fnv-1.hpp
   branches/fix-links/libs/unordered/index.html
      - copied unchanged from r42899, /trunk/libs/unordered/index.html
   branches/fix-links/libs/unordered/test/
      - copied from r42899, /trunk/libs/unordered/test/
   branches/fix-links/libs/unordered/test/Jamfile.v2
      - copied unchanged from r42899, /trunk/libs/unordered/test/Jamfile.v2
   branches/fix-links/libs/unordered/test/exception/
      - copied from r42899, /trunk/libs/unordered/test/exception/
   branches/fix-links/libs/unordered/test/exception/Jamfile.v2
      - copied unchanged from r42899, /trunk/libs/unordered/test/exception/Jamfile.v2
   branches/fix-links/libs/unordered/test/exception/assign_exception_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/exception/assign_exception_tests.cpp
   branches/fix-links/libs/unordered/test/exception/constructor_exception_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/exception/constructor_exception_tests.cpp
   branches/fix-links/libs/unordered/test/exception/containers.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/exception/containers.hpp
   branches/fix-links/libs/unordered/test/exception/copy_exception_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/exception/copy_exception_tests.cpp
   branches/fix-links/libs/unordered/test/exception/erase_exception_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/exception/erase_exception_tests.cpp
   branches/fix-links/libs/unordered/test/exception/insert_exception_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/exception/insert_exception_tests.cpp
   branches/fix-links/libs/unordered/test/exception/rehash_exception_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/exception/rehash_exception_tests.cpp
   branches/fix-links/libs/unordered/test/exception/swap_exception_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/exception/swap_exception_tests.cpp
   branches/fix-links/libs/unordered/test/helpers/
      - copied from r42899, /trunk/libs/unordered/test/helpers/
   branches/fix-links/libs/unordered/test/helpers/allocator.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/helpers/allocator.hpp
   branches/fix-links/libs/unordered/test/helpers/check_return_type.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/helpers/check_return_type.hpp
   branches/fix-links/libs/unordered/test/helpers/equivalent.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/helpers/equivalent.hpp
   branches/fix-links/libs/unordered/test/helpers/exception_test.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/helpers/exception_test.hpp
   branches/fix-links/libs/unordered/test/helpers/fwd.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/helpers/fwd.hpp
   branches/fix-links/libs/unordered/test/helpers/generators.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/helpers/generators.hpp
   branches/fix-links/libs/unordered/test/helpers/helpers.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/helpers/helpers.hpp
   branches/fix-links/libs/unordered/test/helpers/input_iterator.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/helpers/input_iterator.hpp
   branches/fix-links/libs/unordered/test/helpers/invariants.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/helpers/invariants.hpp
   branches/fix-links/libs/unordered/test/helpers/metafunctions.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/helpers/metafunctions.hpp
   branches/fix-links/libs/unordered/test/helpers/random_values.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/helpers/random_values.hpp
   branches/fix-links/libs/unordered/test/helpers/strong.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/helpers/strong.hpp
   branches/fix-links/libs/unordered/test/helpers/test.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/helpers/test.hpp
   branches/fix-links/libs/unordered/test/helpers/tracker.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/helpers/tracker.hpp
   branches/fix-links/libs/unordered/test/objects/
      - copied from r42899, /trunk/libs/unordered/test/objects/
   branches/fix-links/libs/unordered/test/objects/exception.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/objects/exception.hpp
   branches/fix-links/libs/unordered/test/objects/fwd.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/objects/fwd.hpp
   branches/fix-links/libs/unordered/test/objects/memory.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/objects/memory.hpp
   branches/fix-links/libs/unordered/test/objects/minimal.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/objects/minimal.hpp
   branches/fix-links/libs/unordered/test/objects/test.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/objects/test.hpp
   branches/fix-links/libs/unordered/test/unordered/
      - copied from r42899, /trunk/libs/unordered/test/unordered/
   branches/fix-links/libs/unordered/test/unordered/Jamfile.v2
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/Jamfile.v2
   branches/fix-links/libs/unordered/test/unordered/assign_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/assign_tests.cpp
   branches/fix-links/libs/unordered/test/unordered/at_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/at_tests.cpp
   branches/fix-links/libs/unordered/test/unordered/bucket_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/bucket_tests.cpp
   branches/fix-links/libs/unordered/test/unordered/compile_map.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/compile_map.cpp
   branches/fix-links/libs/unordered/test/unordered/compile_set.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/compile_set.cpp
   branches/fix-links/libs/unordered/test/unordered/compile_tests.hpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/compile_tests.hpp
   branches/fix-links/libs/unordered/test/unordered/constructor_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/constructor_tests.cpp
   branches/fix-links/libs/unordered/test/unordered/copy_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/copy_tests.cpp
   branches/fix-links/libs/unordered/test/unordered/equivalent_keys_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/equivalent_keys_tests.cpp
   branches/fix-links/libs/unordered/test/unordered/erase_equiv_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/erase_equiv_tests.cpp
   branches/fix-links/libs/unordered/test/unordered/erase_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/erase_tests.cpp
   branches/fix-links/libs/unordered/test/unordered/find_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/find_tests.cpp
   branches/fix-links/libs/unordered/test/unordered/insert_stable_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/insert_stable_tests.cpp
   branches/fix-links/libs/unordered/test/unordered/insert_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/insert_tests.cpp
   branches/fix-links/libs/unordered/test/unordered/link_test_1.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/link_test_1.cpp
   branches/fix-links/libs/unordered/test/unordered/link_test_2.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/link_test_2.cpp
   branches/fix-links/libs/unordered/test/unordered/load_factor_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/load_factor_tests.cpp
   branches/fix-links/libs/unordered/test/unordered/rehash_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/rehash_tests.cpp
   branches/fix-links/libs/unordered/test/unordered/simple_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/simple_tests.cpp
   branches/fix-links/libs/unordered/test/unordered/swap_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/swap_tests.cpp
   branches/fix-links/libs/unordered/test/unordered/unnecessary_copy_tests.cpp
      - copied unchanged from r42899, /trunk/libs/unordered/test/unordered/unnecessary_copy_tests.cpp
   branches/fix-links/libs/xpressive/test/test_skip.cpp
      - copied unchanged from r42899, /trunk/libs/xpressive/test/test_skip.cpp
   branches/fix-links/tools/build/v2/test/conditionals_multiple.py
      - copied unchanged from r42899, /trunk/tools/build/v2/test/conditionals_multiple.py
   branches/fix-links/tools/build/v2/test/configuration.py
      - copied unchanged from r42899, /trunk/tools/build/v2/test/configuration.py
   branches/fix-links/tools/build/v2/test/default_toolset.py
      - copied unchanged from r42899, /trunk/tools/build/v2/test/default_toolset.py
Removed:
   branches/fix-links/boost/asio/detail/win_iocp_operation.hpp
   branches/fix-links/boost/xpressive/proto/transform/apply.hpp
   branches/fix-links/boost/xpressive/proto/transform/branch.hpp
   branches/fix-links/boost/xpressive/proto/transform/compose.hpp
   branches/fix-links/boost/xpressive/proto/transform/construct.hpp
   branches/fix-links/boost/xpressive/proto/transform/function.hpp
   branches/fix-links/boost/xpressive/proto/transform/list.hpp
   branches/fix-links/libs/iostreams/build/bzip2.jam
   branches/fix-links/libs/iostreams/build/zlib.jam
Properties modified:
   branches/fix-links/ (props changed)
Binary files modified:
   branches/fix-links/libs/statechart/doc/reference.pdf
Text files modified:
   branches/fix-links/boost/asio/detail/epoll_reactor.hpp | 14
   branches/fix-links/boost/asio/detail/kqueue_reactor.hpp | 14
   branches/fix-links/boost/asio/detail/push_options.hpp | 6
   branches/fix-links/boost/asio/detail/socket_ops.hpp | 8
   branches/fix-links/boost/asio/detail/socket_types.hpp | 2
   branches/fix-links/boost/asio/detail/win_iocp_io_service.hpp | 104 ++
   branches/fix-links/boost/asio/detail/win_iocp_socket_service.hpp | 49
   branches/fix-links/boost/asio/error.hpp | 5
   branches/fix-links/boost/asio/ssl/detail/openssl_init.hpp | 16
   branches/fix-links/boost/asio/ssl/detail/openssl_operation.hpp | 43
   branches/fix-links/boost/asio/ssl/detail/openssl_stream_service.hpp | 53 +
   branches/fix-links/boost/config/compiler/intel.hpp | 15
   branches/fix-links/boost/config/compiler/vacpp.hpp | 2
   branches/fix-links/boost/config/platform/hpux.hpp | 3
   branches/fix-links/boost/function_types/components.hpp | 122 +-
   branches/fix-links/boost/function_types/detail/cv_traits.hpp | 4
   branches/fix-links/boost/functional/detail/hash_float.hpp | 31
   branches/fix-links/boost/gil/color_base.hpp | 10
   branches/fix-links/boost/gil/extension/io/png_io_private.hpp | 4
   branches/fix-links/boost/interprocess/allocators/adaptive_pool.hpp | 476 ++++++++----
   branches/fix-links/boost/interprocess/allocators/allocation_type.hpp | 2
   branches/fix-links/boost/interprocess/allocators/allocator.hpp | 93 +-
   branches/fix-links/boost/interprocess/allocators/cached_adaptive_pool.hpp | 515 ++++++-------
   branches/fix-links/boost/interprocess/allocators/cached_node_allocator.hpp | 474 +++++-------
   branches/fix-links/boost/interprocess/allocators/detail/adaptive_node_pool.hpp | 701 +++++++++---------
   branches/fix-links/boost/interprocess/allocators/detail/node_pool.hpp | 342 +++-----
   branches/fix-links/boost/interprocess/allocators/detail/node_tools.hpp | 5
   branches/fix-links/boost/interprocess/allocators/node_allocator.hpp | 481 ++++++++----
   branches/fix-links/boost/interprocess/allocators/private_adaptive_pool.hpp | 417 +++++++++--
   branches/fix-links/boost/interprocess/allocators/private_node_allocator.hpp | 456 ++++++++++++
   branches/fix-links/boost/interprocess/containers/detail/flat_tree.hpp | 2
   branches/fix-links/boost/interprocess/containers/detail/node_alloc_holder.hpp | 46
   branches/fix-links/boost/interprocess/containers/detail/tree.hpp | 8
   branches/fix-links/boost/interprocess/containers/flat_map.hpp | 2
   branches/fix-links/boost/interprocess/containers/flat_set.hpp | 2
   branches/fix-links/boost/interprocess/containers/list.hpp | 9
   branches/fix-links/boost/interprocess/containers/map.hpp | 2
   branches/fix-links/boost/interprocess/containers/set.hpp | 2
   branches/fix-links/boost/interprocess/containers/slist.hpp | 4
   branches/fix-links/boost/interprocess/containers/string.hpp | 4
   branches/fix-links/boost/interprocess/containers/vector.hpp | 29
   branches/fix-links/boost/interprocess/creation_tags.hpp | 2
   branches/fix-links/boost/interprocess/detail/algorithms.hpp | 2
   branches/fix-links/boost/interprocess/detail/atomic.hpp | 2
   branches/fix-links/boost/interprocess/detail/cast_tags.hpp | 2
   branches/fix-links/boost/interprocess/detail/config_begin.hpp | 1
   branches/fix-links/boost/interprocess/detail/in_place_interface.hpp | 2
   branches/fix-links/boost/interprocess/detail/interprocess_tester.hpp | 2
   branches/fix-links/boost/interprocess/detail/iterators.hpp | 8
   branches/fix-links/boost/interprocess/detail/managed_memory_impl.hpp | 2
   branches/fix-links/boost/interprocess/detail/math_functions.hpp | 2
   branches/fix-links/boost/interprocess/detail/min_max.hpp | 2
   branches/fix-links/boost/interprocess/detail/mpl.hpp | 2
   branches/fix-links/boost/interprocess/detail/named_proxy.hpp | 2
   branches/fix-links/boost/interprocess/detail/os_file_functions.hpp | 2
   branches/fix-links/boost/interprocess/detail/os_thread_functions.hpp | 2
   branches/fix-links/boost/interprocess/detail/pointer_type.hpp | 2
   branches/fix-links/boost/interprocess/detail/posix_time_types_wrk.hpp | 2
   branches/fix-links/boost/interprocess/detail/segment_manager_helper.hpp | 2
   branches/fix-links/boost/interprocess/detail/tmp_dir_helpers.hpp | 2
   branches/fix-links/boost/interprocess/detail/type_traits.hpp | 2
   branches/fix-links/boost/interprocess/detail/utilities.hpp | 145 +++
   branches/fix-links/boost/interprocess/detail/version_type.hpp | 2
   branches/fix-links/boost/interprocess/detail/win32_api.hpp | 2
   branches/fix-links/boost/interprocess/detail/workaround.hpp | 6
   branches/fix-links/boost/interprocess/errors.hpp | 2
   branches/fix-links/boost/interprocess/exceptions.hpp | 2
   branches/fix-links/boost/interprocess/file_mapping.hpp | 2
   branches/fix-links/boost/interprocess/indexes/flat_map_index.hpp | 2
   branches/fix-links/boost/interprocess/indexes/iset_index.hpp | 2
   branches/fix-links/boost/interprocess/indexes/iunordered_set_index.hpp | 2
   branches/fix-links/boost/interprocess/indexes/map_index.hpp | 2
   branches/fix-links/boost/interprocess/indexes/null_index.hpp | 2
   branches/fix-links/boost/interprocess/indexes/unordered_map_index.hpp | 2
   branches/fix-links/boost/interprocess/interprocess_fwd.hpp | 18
   branches/fix-links/boost/interprocess/ipc/message_queue.hpp | 2
   branches/fix-links/boost/interprocess/managed_external_buffer.hpp | 7
   branches/fix-links/boost/interprocess/managed_heap_memory.hpp | 2
   branches/fix-links/boost/interprocess/managed_mapped_file.hpp | 2
   branches/fix-links/boost/interprocess/managed_shared_memory.hpp | 2
   branches/fix-links/boost/interprocess/managed_windows_shared_memory.hpp | 2
   branches/fix-links/boost/interprocess/mapped_region.hpp | 2
   branches/fix-links/boost/interprocess/mem_algo/detail/mem_algo_common.hpp | 214 +++++
   branches/fix-links/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp | 60 +
   branches/fix-links/boost/interprocess/mem_algo/rbtree_best_fit.hpp | 613 ++++++++++------
   branches/fix-links/boost/interprocess/mem_algo/simple_seq_fit.hpp | 2
   branches/fix-links/boost/interprocess/offset_ptr.hpp | 6
   branches/fix-links/boost/interprocess/segment_manager.hpp | 27
   branches/fix-links/boost/interprocess/shared_memory_object.hpp | 2
   branches/fix-links/boost/interprocess/smart_ptr/deleter.hpp | 2
   branches/fix-links/boost/interprocess/smart_ptr/detail/shared_count.hpp | 2
   branches/fix-links/boost/interprocess/smart_ptr/detail/sp_counted_base_atomic.hpp | 2
   branches/fix-links/boost/interprocess/smart_ptr/shared_ptr.hpp | 2
   branches/fix-links/boost/interprocess/smart_ptr/weak_ptr.hpp | 2
   branches/fix-links/boost/interprocess/streams/bufferstream.hpp | 2
   branches/fix-links/boost/interprocess/streams/vectorstream.hpp | 2
   branches/fix-links/boost/interprocess/sync/emulation/interprocess_condition.hpp | 2
   branches/fix-links/boost/interprocess/sync/emulation/interprocess_mutex.hpp | 2
   branches/fix-links/boost/interprocess/sync/emulation/interprocess_recursive_mutex.hpp | 2
   branches/fix-links/boost/interprocess/sync/emulation/interprocess_semaphore.hpp | 2
   branches/fix-links/boost/interprocess/sync/emulation/named_creation_functor.hpp | 2
   branches/fix-links/boost/interprocess/sync/file_lock.hpp | 2
   branches/fix-links/boost/interprocess/sync/interprocess_barrier.hpp | 2
   branches/fix-links/boost/interprocess/sync/interprocess_condition.hpp | 2
   branches/fix-links/boost/interprocess/sync/interprocess_mutex.hpp | 2
   branches/fix-links/boost/interprocess/sync/interprocess_recursive_mutex.hpp | 2
   branches/fix-links/boost/interprocess/sync/interprocess_semaphore.hpp | 2
   branches/fix-links/boost/interprocess/sync/interprocess_upgradable_mutex.hpp | 2
   branches/fix-links/boost/interprocess/sync/lock_options.hpp | 2
   branches/fix-links/boost/interprocess/sync/mutex_family.hpp | 2
   branches/fix-links/boost/interprocess/sync/named_condition.hpp | 2
   branches/fix-links/boost/interprocess/sync/named_mutex.hpp | 2
   branches/fix-links/boost/interprocess/sync/named_recursive_mutex.hpp | 2
   branches/fix-links/boost/interprocess/sync/named_semaphore.hpp | 2
   branches/fix-links/boost/interprocess/sync/named_upgradable_mutex.hpp | 2
   branches/fix-links/boost/interprocess/sync/null_mutex.hpp | 2
   branches/fix-links/boost/interprocess/sync/posix/interprocess_condition.hpp | 2
   branches/fix-links/boost/interprocess/sync/posix/interprocess_mutex.hpp | 2
   branches/fix-links/boost/interprocess/sync/posix/interprocess_recursive_mutex.hpp | 2
   branches/fix-links/boost/interprocess/sync/posix/interprocess_semaphore.hpp | 2
   branches/fix-links/boost/interprocess/sync/posix/pthread_helpers.hpp | 2
   branches/fix-links/boost/interprocess/sync/posix/ptime_to_timespec.hpp | 2
   branches/fix-links/boost/interprocess/sync/posix/semaphore_wrapper.hpp | 2
   branches/fix-links/boost/interprocess/sync/scoped_lock.hpp | 2
   branches/fix-links/boost/interprocess/sync/sharable_lock.hpp | 2
   branches/fix-links/boost/interprocess/sync/upgradable_lock.hpp | 2
   branches/fix-links/boost/interprocess/windows_shared_memory.hpp | 2
   branches/fix-links/boost/intrusive/circular_list_algorithms.hpp | 109 ++
   branches/fix-links/boost/intrusive/circular_slist_algorithms.hpp | 165 ++++
   branches/fix-links/boost/intrusive/detail/tree_algorithms.hpp | 4
   branches/fix-links/boost/intrusive/detail/utilities.hpp | 4
   branches/fix-links/boost/intrusive/intrusive_fwd.hpp | 1
   branches/fix-links/boost/intrusive/list.hpp | 51 -
   branches/fix-links/boost/intrusive/options.hpp | 27
   branches/fix-links/boost/intrusive/slist.hpp | 236 ++---
   branches/fix-links/boost/intrusive/slist_hook.hpp | 2
   branches/fix-links/boost/iostreams/code_converter.hpp | 40
   branches/fix-links/boost/iostreams/combine.hpp | 21
   branches/fix-links/boost/iostreams/compose.hpp | 90 ++
   branches/fix-links/boost/iostreams/copy.hpp | 23
   branches/fix-links/boost/iostreams/detail/adapter/direct_adapter.hpp | 23
   branches/fix-links/boost/iostreams/detail/adapter/range_adapter.hpp | 6
   branches/fix-links/boost/iostreams/detail/buffer.hpp | 10
   branches/fix-links/boost/iostreams/detail/config/codecvt.hpp | 5
   branches/fix-links/boost/iostreams/detail/config/disable_warnings.hpp | 1
   branches/fix-links/boost/iostreams/detail/config/enable_warnings.hpp | 2
   branches/fix-links/boost/iostreams/detail/execute.hpp | 18
   branches/fix-links/boost/iostreams/detail/streambuf/direct_streambuf.hpp | 5
   branches/fix-links/boost/iostreams/detail/streambuf/indirect_streambuf.hpp | 31
   branches/fix-links/boost/iostreams/detail/streambuf/linked_streambuf.hpp | 2
   branches/fix-links/boost/iostreams/device/file_descriptor.hpp | 73 +
   branches/fix-links/boost/iostreams/device/mapped_file.hpp | 8
   branches/fix-links/boost/iostreams/filter/aggregate.hpp | 13
   branches/fix-links/boost/iostreams/filter/gzip.hpp | 16
   branches/fix-links/boost/iostreams/filter/line.hpp | 8
   branches/fix-links/boost/iostreams/filter/newline.hpp | 38
   branches/fix-links/boost/iostreams/filter/symmetric.hpp | 20
   branches/fix-links/boost/iostreams/input_sequence.hpp | 1
   branches/fix-links/boost/iostreams/invert.hpp | 5
   branches/fix-links/boost/iostreams/output_sequence.hpp | 1
   branches/fix-links/boost/iostreams/positioning.hpp | 96 +-
   branches/fix-links/boost/iostreams/restrict.hpp | 454 ------------
   branches/fix-links/boost/math/distributions/poisson.hpp | 17
   branches/fix-links/boost/math/tools/test_data.hpp | 1
   branches/fix-links/boost/mpi/config.hpp | 5
   branches/fix-links/boost/mpi/datatype.hpp | 32
   branches/fix-links/boost/mpi/datatype_fwd.hpp | 2
   branches/fix-links/boost/mpi/detail/packed_iprimitive.hpp | 15
   branches/fix-links/boost/mpi/packed_iarchive.hpp | 45 +
   branches/fix-links/boost/mpi/packed_oarchive.hpp | 36
   branches/fix-links/boost/mpi/status.hpp | 2
   branches/fix-links/boost/parameter/aux_/arg_list.hpp | 1
   branches/fix-links/boost/parameter/aux_/cast.hpp | 2
   branches/fix-links/boost/parameter/aux_/default.hpp | 14
   branches/fix-links/boost/parameter/aux_/python/invoker.hpp | 1
   branches/fix-links/boost/parameter/aux_/set.hpp | 2
   branches/fix-links/boost/parameter/macros.hpp | 1
   branches/fix-links/boost/parameter/preprocessor.hpp | 3
   branches/fix-links/boost/range/as_literal.hpp | 6
   branches/fix-links/boost/regex/concepts.hpp | 8
   branches/fix-links/boost/regex/v4/basic_regex_parser.hpp | 11
   branches/fix-links/boost/serialization/complex.hpp | 1
   branches/fix-links/boost/serialization/utility.hpp | 6
   branches/fix-links/boost/spirit/core/primitives/primitives.hpp | 2
   branches/fix-links/boost/statechart/detail/rtti_policy.hpp | 11
   branches/fix-links/boost/statechart/detail/state_base.hpp | 11
   branches/fix-links/boost/statechart/event.hpp | 2
   branches/fix-links/boost/statechart/event_processor.hpp | 5
   branches/fix-links/boost/statechart/fifo_worker.hpp | 14
   branches/fix-links/boost/statechart/in_state_reaction.hpp | 52
   branches/fix-links/boost/statechart/processor_container.hpp | 5
   branches/fix-links/boost/statechart/simple_state.hpp | 5
   branches/fix-links/boost/statechart/state_machine.hpp | 33
   branches/fix-links/boost/statechart/transition.hpp | 102 --
   branches/fix-links/boost/test/impl/debug.ipp | 3
   branches/fix-links/boost/test/impl/execution_monitor.ipp | 3
   branches/fix-links/boost/test/test_tools.hpp | 10
   branches/fix-links/boost/thread/win32/once.hpp | 4
   branches/fix-links/boost/thread/win32/shared_mutex.hpp | 6
   branches/fix-links/boost/thread/win32/thread_primitives.hpp | 4
   branches/fix-links/boost/tr1/detail/config.hpp | 25
   branches/fix-links/boost/type_traits/make_signed.hpp | 4
   branches/fix-links/boost/type_traits/make_unsigned.hpp | 4
   branches/fix-links/boost/utility/value_init.hpp | 40
   branches/fix-links/boost/wave.hpp | 2
   branches/fix-links/boost/wave/cpp_context.hpp | 4
   branches/fix-links/boost/wave/cpp_exceptions.hpp | 2
   branches/fix-links/boost/wave/cpp_iteration_context.hpp | 2
   branches/fix-links/boost/wave/cpp_throw.hpp | 2
   branches/fix-links/boost/wave/cpplexer/convert_trigraphs.hpp | 2
   branches/fix-links/boost/wave/cpplexer/cpp_lex_interface.hpp | 2
   branches/fix-links/boost/wave/cpplexer/cpp_lex_interface_generator.hpp | 2
   branches/fix-links/boost/wave/cpplexer/cpp_lex_iterator.hpp | 2
   branches/fix-links/boost/wave/cpplexer/cpp_lex_token.hpp | 2
   branches/fix-links/boost/wave/cpplexer/cpplexer_exceptions.hpp | 2
   branches/fix-links/boost/wave/cpplexer/detect_include_guards.hpp | 2
   branches/fix-links/boost/wave/cpplexer/re2clex/aq.hpp | 2
   branches/fix-links/boost/wave/cpplexer/re2clex/cpp_re.hpp | 2
   branches/fix-links/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp | 2
   branches/fix-links/boost/wave/cpplexer/re2clex/scanner.hpp | 2
   branches/fix-links/boost/wave/cpplexer/token_cache.hpp | 2
   branches/fix-links/boost/wave/cpplexer/validate_universal_char.hpp | 2
   branches/fix-links/boost/wave/grammars/cpp_chlit_grammar.hpp | 2
   branches/fix-links/boost/wave/grammars/cpp_defined_grammar.hpp | 2
   branches/fix-links/boost/wave/grammars/cpp_defined_grammar_gen.hpp | 2
   branches/fix-links/boost/wave/grammars/cpp_expression_grammar.hpp | 2
   branches/fix-links/boost/wave/grammars/cpp_expression_grammar_gen.hpp | 2
   branches/fix-links/boost/wave/grammars/cpp_expression_value.hpp | 2
   branches/fix-links/boost/wave/grammars/cpp_grammar.hpp | 2
   branches/fix-links/boost/wave/grammars/cpp_grammar_gen.hpp | 2
   branches/fix-links/boost/wave/grammars/cpp_intlit_grammar.hpp | 2
   branches/fix-links/boost/wave/grammars/cpp_literal_grammar_gen.hpp | 2
   branches/fix-links/boost/wave/grammars/cpp_predef_macros_gen.hpp | 2
   branches/fix-links/boost/wave/grammars/cpp_predef_macros_grammar.hpp | 2
   branches/fix-links/boost/wave/grammars/cpp_value_error.hpp | 2
   branches/fix-links/boost/wave/language_support.hpp | 2
   branches/fix-links/boost/wave/preprocessing_hooks.hpp | 2
   branches/fix-links/boost/wave/token_ids.hpp | 229 +++---
   branches/fix-links/boost/wave/util/cpp_ifblock.hpp | 2
   branches/fix-links/boost/wave/util/cpp_include_paths.hpp | 2
   branches/fix-links/boost/wave/util/cpp_iterator.hpp | 2
   branches/fix-links/boost/wave/util/cpp_macromap.hpp | 2
   branches/fix-links/boost/wave/util/cpp_macromap_predef.hpp | 2
   branches/fix-links/boost/wave/util/cpp_macromap_utils.hpp | 2
   branches/fix-links/boost/wave/util/file_position.hpp | 2
   branches/fix-links/boost/wave/util/functor_input.hpp | 2
   branches/fix-links/boost/wave/util/insert_whitespace_detection.hpp | 2
   branches/fix-links/boost/wave/util/interpret_pragma.hpp | 2
   branches/fix-links/boost/wave/util/iteration_context.hpp | 2
   branches/fix-links/boost/wave/util/macro_definition.hpp | 2
   branches/fix-links/boost/wave/util/macro_helpers.hpp | 2
   branches/fix-links/boost/wave/util/pattern_parser.hpp | 2
   branches/fix-links/boost/wave/util/symbol_table.hpp | 2
   branches/fix-links/boost/wave/util/time_conversion_helper.hpp | 2
   branches/fix-links/boost/wave/util/transform_iterator.hpp | 2
   branches/fix-links/boost/wave/util/unput_queue_iterator.hpp | 2
   branches/fix-links/boost/wave/wave_config.hpp | 2
   branches/fix-links/boost/wave/wave_config_constant.hpp | 2
   branches/fix-links/boost/wave/wave_version.hpp | 2
   branches/fix-links/boost/wave/whitespace_handling.hpp | 2
   branches/fix-links/boost/xpressive/detail/core/linker.hpp | 8
   branches/fix-links/boost/xpressive/detail/core/matcher/action_matcher.hpp | 109 +-
   branches/fix-links/boost/xpressive/detail/core/matcher/assert_word_matcher.hpp | 6
   branches/fix-links/boost/xpressive/detail/core/matcher/attr_matcher.hpp | 6
   branches/fix-links/boost/xpressive/detail/core/matcher/charset_matcher.hpp | 4
   branches/fix-links/boost/xpressive/detail/core/matcher/literal_matcher.hpp | 13
   branches/fix-links/boost/xpressive/detail/core/matcher/mark_matcher.hpp | 4
   branches/fix-links/boost/xpressive/detail/core/matcher/optional_matcher.hpp | 8
   branches/fix-links/boost/xpressive/detail/core/matcher/range_matcher.hpp | 4
   branches/fix-links/boost/xpressive/detail/core/matcher/repeat_end_matcher.hpp | 4
   branches/fix-links/boost/xpressive/detail/core/matcher/set_matcher.hpp | 8
   branches/fix-links/boost/xpressive/detail/core/matcher/simple_repeat_matcher.hpp | 4
   branches/fix-links/boost/xpressive/detail/core/matcher/string_matcher.hpp | 4
   branches/fix-links/boost/xpressive/detail/core/peeker.hpp | 34
   branches/fix-links/boost/xpressive/detail/core/results_cache.hpp | 1
   branches/fix-links/boost/xpressive/detail/detail_fwd.hpp | 64 +
   branches/fix-links/boost/xpressive/detail/dynamic/dynamic.hpp | 16
   branches/fix-links/boost/xpressive/detail/dynamic/parser.hpp | 24
   branches/fix-links/boost/xpressive/detail/static/compile.hpp | 2
   branches/fix-links/boost/xpressive/detail/static/grammar.hpp | 214 +++--
   branches/fix-links/boost/xpressive/detail/static/transforms/as_action.hpp | 257 +++---
   branches/fix-links/boost/xpressive/detail/static/transforms/as_alternate.hpp | 198 ++--
   branches/fix-links/boost/xpressive/detail/static/transforms/as_independent.hpp | 80 +
   branches/fix-links/boost/xpressive/detail/static/transforms/as_inverse.hpp | 59
   branches/fix-links/boost/xpressive/detail/static/transforms/as_marker.hpp | 63 -
   branches/fix-links/boost/xpressive/detail/static/transforms/as_matcher.hpp | 30
   branches/fix-links/boost/xpressive/detail/static/transforms/as_modifier.hpp | 51
   branches/fix-links/boost/xpressive/detail/static/transforms/as_quantifier.hpp | 271 +++---
   branches/fix-links/boost/xpressive/detail/static/transforms/as_sequence.hpp | 33
   branches/fix-links/boost/xpressive/detail/static/transforms/as_set.hpp | 246 ++----
   branches/fix-links/boost/xpressive/detail/static/transmogrify.hpp | 10
   branches/fix-links/boost/xpressive/detail/utility/symbols.hpp | 1
   branches/fix-links/boost/xpressive/detail/utility/tracking_ptr.hpp | 1
   branches/fix-links/boost/xpressive/match_results.hpp | 2
   branches/fix-links/boost/xpressive/proto/context/default.hpp | 143 +--
   branches/fix-links/boost/xpressive/proto/debug.hpp | 6
   branches/fix-links/boost/xpressive/proto/deep_copy.hpp | 6
   branches/fix-links/boost/xpressive/proto/detail/funop.hpp | 2
   branches/fix-links/boost/xpressive/proto/expr.hpp | 42
   branches/fix-links/boost/xpressive/proto/fusion.hpp | 411 ++++------
   branches/fix-links/boost/xpressive/proto/generate.hpp | 8
   branches/fix-links/boost/xpressive/proto/make_expr.hpp | 54 +
   branches/fix-links/boost/xpressive/proto/matches.hpp | 239 ++++--
   branches/fix-links/boost/xpressive/proto/operators.hpp | 28
   branches/fix-links/boost/xpressive/proto/proto_fwd.hpp | 403 ++++++++--
   branches/fix-links/boost/xpressive/proto/ref.hpp | 4
   branches/fix-links/boost/xpressive/proto/traits.hpp | 135 ++-
   branches/fix-links/boost/xpressive/proto/transform.hpp | 10
   branches/fix-links/boost/xpressive/proto/transform/arg.hpp | 222 ++---
   branches/fix-links/boost/xpressive/proto/transform/fold.hpp | 291 +++++---
   branches/fix-links/boost/xpressive/proto/transform/fold_tree.hpp | 149 ++-
   branches/fix-links/boost/xpressive/proto/transform/pass_through.hpp | 59 -
   branches/fix-links/boost/xpressive/regex_actions.hpp | 33
   branches/fix-links/boost/xpressive/regex_compiler.hpp | 4
   branches/fix-links/boost/xpressive/regex_primitives.hpp | 184 ++++
   branches/fix-links/boost/xpressive/traits/c_regex_traits.hpp | 1
   branches/fix-links/boost/xpressive/traits/cpp_regex_traits.hpp | 2
   branches/fix-links/boost/xpressive/xpressive_typeof.hpp | 26
   branches/fix-links/doc/Jamfile.v2 | 7
   branches/fix-links/doc/src/boost.xml | 4
   branches/fix-links/libs/asio/example/buffers/reference_counted.cpp | 2
   branches/fix-links/libs/bind/test/bind_lookup_problem_test.cpp | 2
   branches/fix-links/libs/function_types/example/fast_mem_fn_example.cpp | 4
   branches/fix-links/libs/function_types/example/interface_example.cpp | 1
   branches/fix-links/libs/function_types/example/interpreter.hpp | 2
   branches/fix-links/libs/functional/hash/doc/intro.qbk | 9
   branches/fix-links/libs/interprocess/doc/Jamfile.v2 | 2
   branches/fix-links/libs/interprocess/doc/interprocess.qbk | 2
   branches/fix-links/libs/interprocess/proj/vc7ide/interprocesslib.vcproj | 6
   branches/fix-links/libs/interprocess/test/adaptive_node_pool_test.cpp | 2
   branches/fix-links/libs/interprocess/test/adaptive_pool_test.cpp | 24
   branches/fix-links/libs/interprocess/test/cached_adaptive_pool_test.cpp | 24
   branches/fix-links/libs/interprocess/test/cached_node_allocator_test.cpp | 23
   branches/fix-links/libs/interprocess/test/file_mapping_test.cpp | 1
   branches/fix-links/libs/interprocess/test/map_test.hpp | 2
   branches/fix-links/libs/interprocess/test/memory_algorithm_test.cpp | 96 +-
   branches/fix-links/libs/interprocess/test/memory_algorithm_test_template.hpp | 110 ++
   branches/fix-links/libs/interprocess/test/node_allocator_test.cpp | 19
   branches/fix-links/libs/interprocess/test/node_pool_test.hpp | 8
   branches/fix-links/libs/interprocess/test/private_adaptive_pool_test.cpp | 19
   branches/fix-links/libs/interprocess/test/private_node_allocator_test.cpp | 21
   branches/fix-links/libs/interprocess/test/set_test.hpp | 2
   branches/fix-links/libs/interprocess/test/vector_test.cpp | 235 ------
   branches/fix-links/libs/intrusive/example/doc_list_algorithms.cpp | 2
   branches/fix-links/libs/intrusive/example/doc_slist_algorithms.cpp | 2
   branches/fix-links/libs/intrusive/proj/vc7ide/_intrusivelib/_intrusivelib.vcproj | 3
   branches/fix-links/libs/intrusive/test/list_test.cpp | 67 +
   branches/fix-links/libs/intrusive/test/slist_test.cpp | 169 +++-
   branches/fix-links/libs/iostreams/doc/acknowledgments.html | 2
   branches/fix-links/libs/iostreams/example/container_device.hpp | 16
   branches/fix-links/libs/iostreams/example/dictionary_filter.hpp | 7
   branches/fix-links/libs/iostreams/src/file_descriptor.cpp | 190 ++--
   branches/fix-links/libs/iostreams/src/mapped_file.cpp | 12
   branches/fix-links/libs/iostreams/test/Jamfile.v2 | 69 +
   branches/fix-links/libs/iostreams/test/close_test.cpp | 923 -------------------------
   branches/fix-links/libs/iostreams/test/compose_test.cpp | 397 ++++++++++
   branches/fix-links/libs/iostreams/test/copy_test.cpp | 28
   branches/fix-links/libs/iostreams/test/detail/utf8_codecvt_facet.cpp | 3
   branches/fix-links/libs/iostreams/test/detail/utf8_codecvt_facet.hpp | 1
   branches/fix-links/libs/iostreams/test/detail/verification.hpp | 2
   branches/fix-links/libs/iostreams/test/invert_test.cpp | 32
   branches/fix-links/libs/iostreams/test/operation_sequence_test.cpp | 5
   branches/fix-links/libs/iostreams/test/restrict_test.cpp | 235 +++++-
   branches/fix-links/libs/iostreams/test/stream_offset_64bit_test.cpp | 25
   branches/fix-links/libs/iostreams/test/symmetric_filter_test.cpp | 43 +
   branches/fix-links/libs/iostreams/test/tee_test.cpp | 228 ++++++
   branches/fix-links/libs/libraries.htm | 9
   branches/fix-links/libs/maintainers.txt | 2
   branches/fix-links/libs/mpl/doc/src/refmanual/map.rst | 4
   branches/fix-links/libs/numeric/ublas/doc/overview.htm | 2
   branches/fix-links/libs/python/src/object/stl_iterator.cpp | 6
   branches/fix-links/libs/python/test/stl_iterator.py | 10
   branches/fix-links/libs/range/doc/boost_range.html | 2
   branches/fix-links/libs/range/doc/history_ack.html | 8
   branches/fix-links/libs/range/doc/intro.html | 3
   branches/fix-links/libs/range/doc/portability.html | 2
   branches/fix-links/libs/range/doc/utility_class.html | 9
   branches/fix-links/libs/regex/doc/html/boost_regex/background_information/examples.html | 6
   branches/fix-links/libs/regex/doc/html/boost_regex/background_information/history.html | 10
   branches/fix-links/libs/regex/doc/html/boost_regex/background_information/locale.html | 8
   branches/fix-links/libs/regex/doc/html/boost_regex/background_information/standards.html | 10
   branches/fix-links/libs/regex/doc/html/boost_regex/captures.html | 6
   branches/fix-links/libs/regex/doc/html/boost_regex/format/boost_format_syntax.html | 8
   branches/fix-links/libs/regex/doc/html/boost_regex/install.html | 16
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/bad_expression.html | 4
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/basic_regex.html | 18
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/concepts/traits_concept.html | 4
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/deprecated_interfaces/regex_format.html | 2
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/error_type.html | 4
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/match_flag_type.html | 6
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/match_results.html | 4
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/non_std_strings/icu/unicode_algo.html | 6
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/non_std_strings/icu/unicode_iter.html | 4
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_algo.html | 10
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_iter.html | 4
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/posix.html | 8
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/regex_iterator.html | 4
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/regex_match.html | 4
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/regex_replace.html | 4
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/regex_search.html | 4
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/regex_token_iterator.html | 4
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/regex_traits.html | 2
   branches/fix-links/libs/regex/doc/html/boost_regex/ref/sub_match.html | 8
   branches/fix-links/libs/regex/doc/html/boost_regex/syntax/basic_extended.html | 66
   branches/fix-links/libs/regex/doc/html/boost_regex/syntax/basic_syntax.html | 44
   branches/fix-links/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html | 84 +-
   branches/fix-links/libs/regex/doc/html/boost_regex/unicode.html | 4
   branches/fix-links/libs/regex/doc/html/index.html | 4
   branches/fix-links/libs/regex/doc/match_flag_type.qbk | 4
   branches/fix-links/libs/regex/test/regress/test_perl_ex.cpp | 11
   branches/fix-links/libs/serialization/doc/acknowledgments.html | 2
   branches/fix-links/libs/signals/doc/faq.xml | 30
   branches/fix-links/libs/statechart/Statechart.sln | 635 +++++++++--------
   branches/fix-links/libs/statechart/doc/acknowledgments.html | 22
   branches/fix-links/libs/statechart/doc/configuration.html | 27
   branches/fix-links/libs/statechart/doc/faq.html | 47 +
   branches/fix-links/libs/statechart/doc/future_and_history.html | 31
   branches/fix-links/libs/statechart/doc/reference.html | 590 ++++++++-------
   branches/fix-links/libs/statechart/example/BitMachine/BitMachine.vcproj | 512 ++++++++-----
   branches/fix-links/libs/statechart/example/Camera/Camera.vcproj | 574 +++++++++------
   branches/fix-links/libs/statechart/example/Handcrafted/Handcrafted.vcproj | 345 +++++---
   branches/fix-links/libs/statechart/example/Keyboard/Keyboard.vcproj | 485 +++++++-----
   branches/fix-links/libs/statechart/example/Performance/Performance.cpp | 29
   branches/fix-links/libs/statechart/example/Performance/Performance.vcproj | 486 +++++++-----
   branches/fix-links/libs/statechart/example/PingPong/PingPong.cpp | 31
   branches/fix-links/libs/statechart/example/PingPong/PingPong.vcproj | 486 +++++++-----
   branches/fix-links/libs/statechart/example/StopWatch/StopWatch.vcproj | 480 +++++++-----
   branches/fix-links/libs/statechart/test/CustomReactionTest.vcproj | 340 +++++---
   branches/fix-links/libs/statechart/test/DeferralTest.vcproj | 340 +++++---
   branches/fix-links/libs/statechart/test/FifoSchedulerTest.cpp | 11
   branches/fix-links/libs/statechart/test/FifoSchedulerTest.vcproj | 340 +++++---
   branches/fix-links/libs/statechart/test/HistoryTest.vcproj | 340 +++++---
   branches/fix-links/libs/statechart/test/InStateReactionTest.cpp | 39
   branches/fix-links/libs/statechart/test/InStateReactionTest.vcproj | 340 +++++---
   branches/fix-links/libs/statechart/test/InconsistentHistoryTest1.vcproj | 336 +++++---
   branches/fix-links/libs/statechart/test/InconsistentHistoryTest2.vcproj | 336 +++++---
   branches/fix-links/libs/statechart/test/InconsistentHistoryTest3.vcproj | 336 +++++---
   branches/fix-links/libs/statechart/test/InconsistentHistoryTest4.vcproj | 336 +++++---
   branches/fix-links/libs/statechart/test/InconsistentHistoryTest5.vcproj | 336 +++++---
   branches/fix-links/libs/statechart/test/InconsistentHistoryTest6.vcproj | 336 +++++---
   branches/fix-links/libs/statechart/test/InconsistentHistoryTest7.vcproj | 336 +++++---
   branches/fix-links/libs/statechart/test/InconsistentHistoryTest8.vcproj | 336 +++++---
   branches/fix-links/libs/statechart/test/InvalidChartTest1.vcproj | 336 +++++---
   branches/fix-links/libs/statechart/test/InvalidChartTest2.vcproj | 336 +++++---
   branches/fix-links/libs/statechart/test/InvalidChartTest3.vcproj | 336 +++++---
   branches/fix-links/libs/statechart/test/InvalidResultAssignTest.vcproj | 336 +++++---
   branches/fix-links/libs/statechart/test/InvalidResultCopyTest.vcproj | 340 +++++---
   branches/fix-links/libs/statechart/test/InvalidResultDefCtorTest.vcproj | 336 +++++---
   branches/fix-links/libs/statechart/test/InvalidTransitionTest1.vcproj | 336 +++++---
   branches/fix-links/libs/statechart/test/InvalidTransitionTest2.vcproj | 336 +++++---
   branches/fix-links/libs/statechart/test/StateCastTest.vcproj | 340 +++++---
   branches/fix-links/libs/statechart/test/StateIterationTest.vcproj | 340 +++++---
   branches/fix-links/libs/statechart/test/TerminationTest.vcproj | 340 +++++---
   branches/fix-links/libs/statechart/test/TransitionTest.vcproj | 365 ++++++----
   branches/fix-links/libs/statechart/test/TuTest.cpp | 2
   branches/fix-links/libs/statechart/test/TuTest.hpp | 11
   branches/fix-links/libs/statechart/test/TuTest.vcproj | 365 ++++++----
   branches/fix-links/libs/statechart/test/TypeInfoTest.vcproj | 340 +++++---
   branches/fix-links/libs/statechart/test/UnconsumedResultTest.vcproj | 340 +++++---
   branches/fix-links/libs/statechart/test/UnsuppDeepHistoryTest.vcproj | 336 +++++---
   branches/fix-links/libs/system/test/Jamfile.v2 | 17
   branches/fix-links/libs/thread/src/tss_null.cpp | 2
   branches/fix-links/libs/tr1/test/test_random.cpp | 1
   branches/fix-links/libs/type_traits/test/is_convertible_test.cpp | 6
   branches/fix-links/libs/type_traits/test/make_signed_test.cpp | 16
   branches/fix-links/libs/type_traits/test/make_unsigned_test.cpp | 16
   branches/fix-links/libs/utility/value_init.htm | 213 +++++
   branches/fix-links/libs/utility/value_init_test.cpp | 37
   branches/fix-links/libs/wave/ChangeLog | 5
   branches/fix-links/libs/wave/build/Jamfile.v2 | 2
   branches/fix-links/libs/wave/doc/acknowledgements.html | 2
   branches/fix-links/libs/wave/doc/class_ref_ctxpolicy_depr.html | 2
   branches/fix-links/libs/wave/doc/class_reference_context.html | 2
   branches/fix-links/libs/wave/doc/class_reference_ctxpolicy.html | 2
   branches/fix-links/libs/wave/doc/class_reference_filepos.html | 2
   branches/fix-links/libs/wave/doc/class_reference_inptpolcy.html | 2
   branches/fix-links/libs/wave/doc/class_reference_lexer.html | 2
   branches/fix-links/libs/wave/doc/class_reference_tokentype.html | 2
   branches/fix-links/libs/wave/doc/compiletime_config.html | 2
   branches/fix-links/libs/wave/doc/introduction.html | 2
   branches/fix-links/libs/wave/doc/macro_expansion_process.html | 2
   branches/fix-links/libs/wave/doc/predefined_macros.html | 2
   branches/fix-links/libs/wave/doc/preface.html | 2
   branches/fix-links/libs/wave/doc/quickstart.html | 2
   branches/fix-links/libs/wave/doc/references.html | 2
   branches/fix-links/libs/wave/doc/samples.html | 2
   branches/fix-links/libs/wave/doc/supported_pragmas.html | 2
   branches/fix-links/libs/wave/doc/token_ids.html | 9
   branches/fix-links/libs/wave/doc/tracing_facility.html | 2
   branches/fix-links/libs/wave/doc/wave_driver.html | 2
   branches/fix-links/libs/wave/index.html | 2
   branches/fix-links/libs/wave/samples/advanced_hooks/advanced_hooks.cpp | 2
   branches/fix-links/libs/wave/samples/advanced_hooks/advanced_hooks.hpp | 2
   branches/fix-links/libs/wave/samples/advanced_hooks/build/Jamfile.v2 | 2
   branches/fix-links/libs/wave/samples/cpp_tokens/build/Jamfile.v2 | 2
   branches/fix-links/libs/wave/samples/cpp_tokens/cpp_tokens.cpp | 2
   branches/fix-links/libs/wave/samples/cpp_tokens/cpp_tokens.hpp | 2
   branches/fix-links/libs/wave/samples/cpp_tokens/cpp_tokens_config.hpp | 2
   branches/fix-links/libs/wave/samples/cpp_tokens/instantiate_cpp_exprgrammar.cpp | 2
   branches/fix-links/libs/wave/samples/cpp_tokens/instantiate_cpp_grammar.cpp | 2
   branches/fix-links/libs/wave/samples/cpp_tokens/instantiate_cpp_literalgrs.cpp | 2
   branches/fix-links/libs/wave/samples/cpp_tokens/instantiate_defined_grammar.cpp | 2
   branches/fix-links/libs/wave/samples/cpp_tokens/instantiate_slex_lexer.cpp | 2
   branches/fix-links/libs/wave/samples/cpp_tokens/slex/cpp_slex_lexer.hpp | 3
   branches/fix-links/libs/wave/samples/cpp_tokens/slex/lexer.hpp | 2
   branches/fix-links/libs/wave/samples/cpp_tokens/slex_interface.hpp | 2
   branches/fix-links/libs/wave/samples/cpp_tokens/slex_iterator.hpp | 2
   branches/fix-links/libs/wave/samples/cpp_tokens/slex_token.hpp | 2
   branches/fix-links/libs/wave/samples/hannibal/build/Jamfile.v2 | 2
   branches/fix-links/libs/wave/samples/hannibal/hannibal.cpp | 2
   branches/fix-links/libs/wave/samples/hannibal/translation_unit_parser.h | 2
   branches/fix-links/libs/wave/samples/hannibal/translation_unit_skipper.h | 2
   branches/fix-links/libs/wave/samples/lexed_tokens/build/Jamfile.v2 | 2
   branches/fix-links/libs/wave/samples/lexed_tokens/lexed_tokens.cpp | 2
   branches/fix-links/libs/wave/samples/list_includes/build/Jamfile.v2 | 2
   branches/fix-links/libs/wave/samples/list_includes/instantiate_cpp_exprgrammar.cpp | 2
   branches/fix-links/libs/wave/samples/list_includes/instantiate_cpp_grammar.cpp | 2
   branches/fix-links/libs/wave/samples/list_includes/instantiate_cpp_literalgrs.cpp | 2
   branches/fix-links/libs/wave/samples/list_includes/instantiate_defined_grammar.cpp | 2
   branches/fix-links/libs/wave/samples/list_includes/instantiate_lexertl_lexer.cpp | 2
   branches/fix-links/libs/wave/samples/list_includes/lexertl/lexertl_lexer.hpp | 2
   branches/fix-links/libs/wave/samples/list_includes/lexertl/wave_lexertl_config.hpp | 2
   branches/fix-links/libs/wave/samples/list_includes/lexertl/wave_lexertl_tables.hpp | 2
   branches/fix-links/libs/wave/samples/list_includes/lexertl_interface.hpp | 2
   branches/fix-links/libs/wave/samples/list_includes/lexertl_iterator.hpp | 2
   branches/fix-links/libs/wave/samples/list_includes/list_includes.cpp | 2
   branches/fix-links/libs/wave/samples/list_includes/list_includes.hpp | 2
   branches/fix-links/libs/wave/samples/list_includes/list_includes_config.hpp | 2
   branches/fix-links/libs/wave/samples/list_includes/list_includes_version.hpp | 2
   branches/fix-links/libs/wave/samples/quick_start/build/Jamfile.v2 | 2
   branches/fix-links/libs/wave/samples/quick_start/quick_start.cpp | 2
   branches/fix-links/libs/wave/samples/real_positions/build/Jamfile.v2 | 2
   branches/fix-links/libs/wave/samples/real_positions/correct_token_positions.hpp | 2
   branches/fix-links/libs/wave/samples/real_positions/instantiate_cpp_exprgrammar.cpp | 2
   branches/fix-links/libs/wave/samples/real_positions/instantiate_cpp_grammar.cpp | 2
   branches/fix-links/libs/wave/samples/real_positions/instantiate_cpp_literalgrs.cpp | 2
   branches/fix-links/libs/wave/samples/real_positions/instantiate_defined_grammar.cpp | 2
   branches/fix-links/libs/wave/samples/real_positions/instantiate_re2c_lexer.cpp | 2
   branches/fix-links/libs/wave/samples/real_positions/instantiate_re2c_lexer_str.cpp | 2
   branches/fix-links/libs/wave/samples/real_positions/real_position_token.hpp | 2
   branches/fix-links/libs/wave/samples/real_positions/real_positions.cpp | 2
   branches/fix-links/libs/wave/samples/token_statistics/build/Jamfile.v2 | 2
   branches/fix-links/libs/wave/samples/token_statistics/collect_token_statistics.hpp | 2
   branches/fix-links/libs/wave/samples/token_statistics/instantiate_cpp_grammar.cpp | 2
   branches/fix-links/libs/wave/samples/token_statistics/instantiate_defined_grammar.cpp | 2
   branches/fix-links/libs/wave/samples/token_statistics/instantiate_xlex_lexer.cpp | 2
   branches/fix-links/libs/wave/samples/token_statistics/token_statistics.cpp | 2
   branches/fix-links/libs/wave/samples/token_statistics/token_statistics.hpp | 2
   branches/fix-links/libs/wave/samples/token_statistics/token_statistics_version.hpp | 2
   branches/fix-links/libs/wave/samples/token_statistics/xlex/xlex_lexer.hpp | 2
   branches/fix-links/libs/wave/samples/token_statistics/xlex/xpressive_lexer.hpp | 2
   branches/fix-links/libs/wave/samples/token_statistics/xlex_interface.hpp | 2
   branches/fix-links/libs/wave/samples/token_statistics/xlex_iterator.hpp | 2
   branches/fix-links/libs/wave/samples/waveidl/build/Jamfile.v2 | 2
   branches/fix-links/libs/wave/samples/waveidl/idl.cpp | 4
   branches/fix-links/libs/wave/samples/waveidl/idl.hpp | 2
   branches/fix-links/libs/wave/samples/waveidl/idl_config.hpp | 2
   branches/fix-links/libs/wave/samples/waveidl/idl_version.hpp | 2
   branches/fix-links/libs/wave/samples/waveidl/idllexer/idl.re | 2
   branches/fix-links/libs/wave/samples/waveidl/idllexer/idl_lex_interface.hpp | 2
   branches/fix-links/libs/wave/samples/waveidl/idllexer/idl_lex_iterator.hpp | 2
   branches/fix-links/libs/wave/samples/waveidl/idllexer/idl_re.cpp | 2
   branches/fix-links/libs/wave/samples/waveidl/idllexer/idl_re.hpp | 2
   branches/fix-links/libs/wave/samples/waveidl/idllexer/idl_re2c_lexer.hpp | 2
   branches/fix-links/libs/wave/samples/waveidl/instantiate_cpp_grammar.cpp | 2
   branches/fix-links/libs/wave/samples/waveidl/instantiate_defined_grammar.cpp | 2
   branches/fix-links/libs/wave/samples/waveidl/instantiate_predef_macros.cpp | 2
   branches/fix-links/libs/wave/samples/waveidl/instantiate_re2c_lexer.cpp | 2
   branches/fix-links/libs/wave/samples/waveidl/instantiate_re2c_lexer_str.cpp | 2
   branches/fix-links/libs/wave/src/cpplexer/re2clex/aq.cpp | 2
   branches/fix-links/libs/wave/src/cpplexer/re2clex/cpp.re | 2
   branches/fix-links/libs/wave/src/cpplexer/re2clex/cpp_re.cpp | 2
   branches/fix-links/libs/wave/src/cpplexer/re2clex/cpp_re.inc | 2
   branches/fix-links/libs/wave/src/cpplexer/re2clex/strict_cpp.re | 2
   branches/fix-links/libs/wave/src/cpplexer/re2clex/strict_cpp_re.inc | 2
   branches/fix-links/libs/wave/src/instantiate_cpp_exprgrammar.cpp | 2
   branches/fix-links/libs/wave/src/instantiate_cpp_grammar.cpp | 2
   branches/fix-links/libs/wave/src/instantiate_cpp_literalgrs.cpp | 2
   branches/fix-links/libs/wave/src/instantiate_defined_grammar.cpp | 2
   branches/fix-links/libs/wave/src/instantiate_predef_macros.cpp | 2
   branches/fix-links/libs/wave/src/instantiate_re2c_lexer.cpp | 2
   branches/fix-links/libs/wave/src/instantiate_re2c_lexer_str.cpp | 2
   branches/fix-links/libs/wave/src/token_ids.cpp | 414 +++++-----
   branches/fix-links/libs/wave/src/wave_config_constant.cpp | 2
   branches/fix-links/libs/wave/test/build/Jamfile.v2 | 2
   branches/fix-links/libs/wave/test/testlexers/cpp_tokens.hpp | 2
   branches/fix-links/libs/wave/test/testlexers/test_lexertl_lexer.cpp | 2
   branches/fix-links/libs/wave/test/testlexers/test_re2c_lexer.cpp | 2
   branches/fix-links/libs/wave/test/testlexers/test_slex_lexer.cpp | 2
   branches/fix-links/libs/wave/test/testlexers/test_xlex_lexer.cpp | 2
   branches/fix-links/libs/wave/test/testwave/cmd_line_utils.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_001.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_002.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_003.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_004.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_005.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_006.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_007.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_008.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_009.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_010.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_011.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_012.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_013.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_014.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_015.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_016.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_017.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_018.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_019.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_020.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_021.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_022.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_023.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_024.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_025.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_026.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_027.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_028.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_029.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_030.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_031.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_032.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_033.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_034.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_035.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_036.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_1_037.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_2_001.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_2_002.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_2_003.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_2_004.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_2_005.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_2_006.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_2_007.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_2_008.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_2_009.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_2_010.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_2_011.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_2_012.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_2_013.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_2_014.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_2_015.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_2_016.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_2_017.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_3_001.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_3_002.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_3_003.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_3_004.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_4_001.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_4_002.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_4_003.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_4_004.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_001.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_002.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_003.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_004.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_005.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_006.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_007.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_007.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_008.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_009.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_010.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_011.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_012.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_013.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_014.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_015.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_016.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_017.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_018.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_019.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_020.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_021.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_022.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_023.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_024.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_025.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_026.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_027.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_028.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_029.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_030.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_031.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_031.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_032.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_033.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_034.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_035.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_035.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_035_01.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_035_02.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_035_03.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_035_04.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_035_05.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_035_06.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_035_07.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_035_08.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_035_09.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_035_10.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_035_11.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_035_12.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_035_13.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_035_14.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_5_035_15.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_001.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_002.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_003.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_004.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_005.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_006.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_007.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_008.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_009.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_010.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_011.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_012.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_013.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_014.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_015.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_016.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_017.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_018.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_019.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_020.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_021.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_022.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_023.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_024.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_025.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_026.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_027.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_028.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_029.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_029.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_030.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_030.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_031.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_032.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_033.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_034.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_035.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_036.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_037.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_038.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_039.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_040.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_041.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_042.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_043.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_044.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_045.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_046.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_047.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_048.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_049.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_050.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_051.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_052.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_053.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_054.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_055.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_056.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_057.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_058.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_059.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_060.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_061.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_062.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_063.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_063.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_064.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_065.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_066.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_066.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_067.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_067.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_068.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_6_069.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_001.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_002.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_003.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_004.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_005.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_006.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_007.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_008.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_009.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_010.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_011.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_012.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_013.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_014.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_015.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_016.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_016.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_017.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testfiles/t_9_018.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testwave.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testwave_app.cpp | 4
   branches/fix-links/libs/wave/test/testwave/testwave_app.hpp | 2
   branches/fix-links/libs/wave/test/testwave/testwave_app_dll.cpp | 2
   branches/fix-links/libs/wave/test/testwave/testwave_dll.cpp | 2
   branches/fix-links/libs/xpressive/doc/acknowledgements.qbk | 2
   branches/fix-links/libs/xpressive/doc/actions.qbk | 2
   branches/fix-links/libs/xpressive/doc/concepts.qbk | 2
   branches/fix-links/libs/xpressive/doc/dynamic_regexes.qbk | 2
   branches/fix-links/libs/xpressive/doc/examples.qbk | 2
   branches/fix-links/libs/xpressive/doc/grammars.qbk | 2
   branches/fix-links/libs/xpressive/doc/history.qbk | 2
   branches/fix-links/libs/xpressive/doc/installation.qbk | 2
   branches/fix-links/libs/xpressive/doc/introduction.qbk | 2
   branches/fix-links/libs/xpressive/doc/matching.qbk | 2
   branches/fix-links/libs/xpressive/doc/nyi.qbk | 2
   branches/fix-links/libs/xpressive/doc/perf.qbk | 2
   branches/fix-links/libs/xpressive/doc/preface.qbk | 2
   branches/fix-links/libs/xpressive/doc/quick_start.qbk | 2
   branches/fix-links/libs/xpressive/doc/regexpp_diffs.qbk | 2
   branches/fix-links/libs/xpressive/doc/results.qbk | 2
   branches/fix-links/libs/xpressive/doc/static_regexes.qbk | 2
   branches/fix-links/libs/xpressive/doc/substitutions.qbk | 2
   branches/fix-links/libs/xpressive/doc/tips_n_tricks.qbk | 2
   branches/fix-links/libs/xpressive/doc/tokenization.qbk | 2
   branches/fix-links/libs/xpressive/doc/traits.qbk | 2
   branches/fix-links/libs/xpressive/doc/xpressive.qbk | 2
   branches/fix-links/libs/xpressive/proto/doc/Jamfile.v2 | 16
   branches/fix-links/libs/xpressive/proto/doc/acknowledgements.qbk | 2
   branches/fix-links/libs/xpressive/proto/doc/calculator.qbk | 4
   branches/fix-links/libs/xpressive/proto/doc/examples.qbk | 2
   branches/fix-links/libs/xpressive/proto/doc/extensibility.qbk | 2
   branches/fix-links/libs/xpressive/proto/doc/grammars.qbk | 30
   branches/fix-links/libs/xpressive/proto/doc/history.qbk | 7
   branches/fix-links/libs/xpressive/proto/doc/implementation.qbk | 2
   branches/fix-links/libs/xpressive/proto/doc/installation.qbk | 12
   branches/fix-links/libs/xpressive/proto/doc/preface.qbk | 5
   branches/fix-links/libs/xpressive/proto/doc/proto.qbk | 5
   branches/fix-links/libs/xpressive/proto/doc/protodoc.xml | 1224 +++++++++++++++++----------------
   branches/fix-links/libs/xpressive/proto/doc/quick_start.qbk | 2
   branches/fix-links/libs/xpressive/proto/doc/rationale.qbk | 2
   branches/fix-links/libs/xpressive/proto/doc/transforms.qbk | 1445 ++++++++++++++++++++++++---------------
   branches/fix-links/libs/xpressive/proto/example/calc1.cpp | 4
   branches/fix-links/libs/xpressive/proto/example/calc2.cpp | 22
   branches/fix-links/libs/xpressive/proto/example/calc3.cpp | 117 --
   branches/fix-links/libs/xpressive/proto/example/hello.cpp | 2
   branches/fix-links/libs/xpressive/proto/example/lazy_vector.cpp | 10
   branches/fix-links/libs/xpressive/proto/example/mixed.cpp | 97 +-
   branches/fix-links/libs/xpressive/proto/example/rgb.cpp | 72 +
   branches/fix-links/libs/xpressive/proto/example/tarray.cpp | 24
   branches/fix-links/libs/xpressive/proto/example/vec3.cpp | 50
   branches/fix-links/libs/xpressive/proto/example/vector.cpp | 8
   branches/fix-links/libs/xpressive/proto/test/calculator.cpp | 14
   branches/fix-links/libs/xpressive/proto/test/examples.cpp | 373 ++++++---
   branches/fix-links/libs/xpressive/proto/test/lambda.cpp | 92 +-
   branches/fix-links/libs/xpressive/proto/test/matches.cpp | 30
   branches/fix-links/libs/xpressive/proto/test/proto_fusion.cpp | 20
   branches/fix-links/libs/xpressive/proto/test/proto_fusion_s.cpp | 38
   branches/fix-links/libs/xpressive/proto/test/toy_spirit.cpp | 104 +-
   branches/fix-links/libs/xpressive/proto/test/toy_spirit2.cpp | 365 +++------
   branches/fix-links/libs/xpressive/test/Jamfile.v2 | 2
   branches/fix-links/status/Jamfile.v2 | 3
   branches/fix-links/status/explicit-failures-markup.xml | 223 ++++--
   branches/fix-links/tools/bcp/add_path.cpp | 7
   branches/fix-links/tools/boostbook/doc/reference.dtdxml | 2
   branches/fix-links/tools/boostbook/doc/reference.xml | 2
   branches/fix-links/tools/boostbook/dtd/boostbook.dtd | 2
   branches/fix-links/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl | 28
   branches/fix-links/tools/boostbook/xsl/type.xsl | 8
   branches/fix-links/tools/build/v2/build-system.jam | 1251 +++++++++++++++++++---------------
   branches/fix-links/tools/build/v2/build/alias.jam | 52
   branches/fix-links/tools/build/v2/build/build-request.jam | 185 ++--
   branches/fix-links/tools/build/v2/build/feature.jam | 869 +++++++++++------------
   branches/fix-links/tools/build/v2/build/generators.jam | 902 ++++++++++++------------
   branches/fix-links/tools/build/v2/build/modifiers.jam | 16
   branches/fix-links/tools/build/v2/build/project.jam | 799 +++++++++++-----------
   branches/fix-links/tools/build/v2/build/property-set.jam | 296 +++----
   branches/fix-links/tools/build/v2/build/property.jam | 424 +++++------
   branches/fix-links/tools/build/v2/build/targets.jam | 1262 ++++++++++++++++------------------
   branches/fix-links/tools/build/v2/build/toolset.jam | 374 +++++-----
   branches/fix-links/tools/build/v2/build/type.jam | 299 ++++---
   branches/fix-links/tools/build/v2/build/version.jam | 8
   branches/fix-links/tools/build/v2/build/virtual-target.jam | 879 ++++++++++++------------
   branches/fix-links/tools/build/v2/doc/src/architecture.xml | 2
   branches/fix-links/tools/build/v2/doc/src/extending.xml | 106 +-
   branches/fix-links/tools/build/v2/doc/src/faq.xml | 10
   branches/fix-links/tools/build/v2/doc/src/reference.xml | 8
   branches/fix-links/tools/build/v2/doc/src/tutorial.xml | 11
   branches/fix-links/tools/build/v2/hacking.txt | 80 +-
   branches/fix-links/tools/build/v2/kernel/bootstrap.jam | 3
   branches/fix-links/tools/build/v2/kernel/errors.jam | 134 +-
   branches/fix-links/tools/build/v2/kernel/modules.jam | 265 +++---
   branches/fix-links/tools/build/v2/notes/build_dir_option.txt | 49
   branches/fix-links/tools/build/v2/options/help.jam | 11
   branches/fix-links/tools/build/v2/roll.sh | 5
   branches/fix-links/tools/build/v2/test/BoostBuild.py | 443 ++++++-----
   branches/fix-links/tools/build/v2/test/abs_workdir.py | 29
   branches/fix-links/tools/build/v2/test/alias.py | 122 ++-
   branches/fix-links/tools/build/v2/test/conditionals.py | 58
   branches/fix-links/tools/build/v2/test/conditionals2.py | 33
   branches/fix-links/tools/build/v2/test/conditionals3.py | 21
   branches/fix-links/tools/build/v2/test/double_loading.py | 39
   branches/fix-links/tools/build/v2/test/library_property.py | 2
   branches/fix-links/tools/build/v2/test/module-actions/bootstrap.jam | 46
   branches/fix-links/tools/build/v2/test/module_actions.py | 35
   branches/fix-links/tools/build/v2/test/project_test3.py | 2
   branches/fix-links/tools/build/v2/test/tag.py | 148 ++-
   branches/fix-links/tools/build/v2/test/test_all.py | 9
   branches/fix-links/tools/build/v2/test/timedata.py | 31
   branches/fix-links/tools/build/v2/tools/builtin.jam | 941 ++++++++++++-------------
   branches/fix-links/tools/build/v2/tools/cast.jam | 54
   branches/fix-links/tools/build/v2/tools/common.jam | 455 ++++++------
   branches/fix-links/tools/build/v2/tools/doxygen.jam | 2
   branches/fix-links/tools/build/v2/tools/generate.jam | 74 -
   branches/fix-links/tools/build/v2/tools/gettext.jam | 96 +-
   branches/fix-links/tools/build/v2/tools/intel-win.jam | 4
   branches/fix-links/tools/build/v2/tools/intel.jam | 1
   branches/fix-links/tools/build/v2/tools/msvc.jam | 451 ++++++------
   branches/fix-links/tools/build/v2/tools/notfile.jam | 46
   branches/fix-links/tools/build/v2/tools/package.jam | 2
   branches/fix-links/tools/build/v2/tools/pch.jam | 56
   branches/fix-links/tools/build/v2/tools/python.jam | 58
   branches/fix-links/tools/build/v2/tools/qt4.jam | 48
   branches/fix-links/tools/build/v2/tools/stage.jam | 359 +++++----
   branches/fix-links/tools/build/v2/tools/testing.jam | 419 +++++-----
   branches/fix-links/tools/build/v2/util/doc.jam | 96 +-
   branches/fix-links/tools/build/v2/util/indirect.jam | 65
   branches/fix-links/tools/build/v2/util/order.jam | 130 +-
   branches/fix-links/tools/build/v2/util/os.jam | 78 +
   branches/fix-links/tools/build/v2/util/path.jam | 118 +-
   branches/fix-links/tools/jam/doc/bjam.qbk | 2
   branches/fix-links/tools/jam/src/build.bat | 2
   branches/fix-links/tools/jam/src/builtins.c | 23
   branches/fix-links/tools/jam/src/make1.c | 2
   branches/fix-links/tools/jam/src/modules/property-set.c | 33
   branches/fix-links/tools/jam/src/native.c | 10
   branches/fix-links/tools/quickbook/detail/actions.cpp | 30
   branches/fix-links/tools/quickbook/detail/actions.hpp | 12
   branches/fix-links/tools/quickbook/detail/actions_class.cpp | 3
   branches/fix-links/tools/quickbook/detail/actions_class.hpp | 4
   branches/fix-links/tools/quickbook/doc_info.hpp | 9
   branches/fix-links/tools/regression/src/process_jam_log.cpp | 3
   branches/fix-links/tools/wave/build/Jamfile.v2 | 2
   branches/fix-links/tools/wave/cpp.cpp | 4
   branches/fix-links/tools/wave/cpp.hpp | 2
   branches/fix-links/tools/wave/cpp_config.hpp | 2
   branches/fix-links/tools/wave/cpp_version.hpp | 2
   branches/fix-links/tools/wave/stop_watch.hpp | 2
   branches/fix-links/tools/wave/trace_macro_expansion.hpp | 2
   948 files changed, 27657 insertions(+), 22183 deletions(-)

Modified: branches/fix-links/boost/asio/detail/epoll_reactor.hpp
==============================================================================
--- branches/fix-links/boost/asio/detail/epoll_reactor.hpp (original)
+++ branches/fix-links/boost/asio/detail/epoll_reactor.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -67,7 +67,8 @@
       pending_cancellations_(),
       stop_thread_(false),
       thread_(0),
- shutdown_(false)
+ shutdown_(false),
+ need_epoll_wait_(true)
   {
     // Start the reactor's internal thread only if needed.
     if (Own_Thread)
@@ -388,7 +389,9 @@
 
     // Block on the epoll descriptor.
     epoll_event events[128];
- int num_events = epoll_wait(epoll_fd_, events, 128, timeout);
+ int num_events = (block || need_epoll_wait_)
+ ? epoll_wait(epoll_fd_, events, 128, timeout)
+ : 0;
 
     lock.lock();
     wait_in_progress_ = false;
@@ -479,6 +482,10 @@
       cancel_ops_unlocked(pending_cancellations_[i]);
     pending_cancellations_.clear();
 
+ // Determine whether epoll_wait should be called when the reactor next runs.
+ need_epoll_wait_ = !read_op_queue_.empty()
+ || !write_op_queue_.empty() || !except_op_queue_.empty();
+
     cleanup_operations_and_timers(lock);
   }
 
@@ -633,6 +640,9 @@
 
   // Whether the service has been shut down.
   bool shutdown_;
+
+ // Whether we need to call epoll_wait the next time the reactor is run.
+ bool need_epoll_wait_;
 };
 
 } // namespace detail

Modified: branches/fix-links/boost/asio/detail/kqueue_reactor.hpp
==============================================================================
--- branches/fix-links/boost/asio/detail/kqueue_reactor.hpp (original)
+++ branches/fix-links/boost/asio/detail/kqueue_reactor.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -75,7 +75,8 @@
       pending_cancellations_(),
       stop_thread_(false),
       thread_(0),
- shutdown_(false)
+ shutdown_(false),
+ need_kqueue_wait_(true)
   {
     // Start the reactor's internal thread only if needed.
     if (Own_Thread)
@@ -374,7 +375,9 @@
 
     // Block on the kqueue descriptor.
     struct kevent events[128];
- int num_events = kevent(kqueue_fd_, 0, 0, events, 128, timeout);
+ int num_events = (block || need_kqueue_wait_)
+ ? kevent(kqueue_fd_, 0, 0, events, 128, timeout)
+ : 0;
 
     lock.lock();
     wait_in_progress_ = false;
@@ -479,6 +482,10 @@
       cancel_ops_unlocked(pending_cancellations_[i]);
     pending_cancellations_.clear();
 
+ // Determine whether kqueue needs to be called next time the reactor is run.
+ need_kqueue_wait_ = !read_op_queue_.empty()
+ || !write_op_queue_.empty() || !except_op_queue_.empty();
+
     cleanup_operations_and_timers(lock);
   }
 
@@ -631,6 +638,9 @@
 
   // Whether the service has been shut down.
   bool shutdown_;
+
+ // Whether we need to call kqueue the next time the reactor is run.
+ bool need_kqueue_wait_;
 };
 
 } // namespace detail

Modified: branches/fix-links/boost/asio/detail/push_options.hpp
==============================================================================
--- branches/fix-links/boost/asio/detail/push_options.hpp (original)
+++ branches/fix-links/boost/asio/detail/push_options.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -90,6 +90,12 @@
 # pragma warning (disable:4244)
 # pragma warning (disable:4355)
 # pragma warning (disable:4675)
+# if defined(_M_IX86) && defined(_Wp64)
+// The /Wp64 option is broken. If you want to check 64 bit portability, use a
+// 64 bit compiler!
+# pragma warning (disable:4311)
+# pragma warning (disable:4312)
+# endif // defined(_M_IX86) && defined(_Wp64)
 # pragma pack (push, 8)
 // Note that if the /Og optimisation flag is enabled with MSVC6, the compiler
 // has a tendency to incorrectly optimise away some calls to member template

Modified: branches/fix-links/boost/asio/detail/socket_ops.hpp
==============================================================================
--- branches/fix-links/boost/asio/detail/socket_ops.hpp (original)
+++ branches/fix-links/boost/asio/detail/socket_ops.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1812,19 +1812,21 @@
 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) || defined(UNDER_CE)
   // Building for Windows XP, Windows Server 2003, or later.
   clear_error(ec);
- int error = ::getnameinfo(addr, addrlen, host, static_cast<DWORD>(hostlen),
+ int error = ::getnameinfo(addr, static_cast<socklen_t>(addrlen),
+ host, static_cast<DWORD>(hostlen),
       serv, static_cast<DWORD>(servlen), flags);
   return ec = translate_addrinfo_error(error);
 # else
   // Building for Windows 2000 or earlier.
   typedef int (WSAAPI *gni_t)(const socket_addr_type*,
- int, char*, std::size_t, char*, std::size_t, int);
+ int, char*, DWORD, char*, DWORD, int);
   if (HMODULE winsock_module = ::GetModuleHandleA("ws2_32"))
   {
     if (gni_t gni = (gni_t)::GetProcAddress(winsock_module, "getnameinfo"))
     {
       clear_error(ec);
- int error = gni(addr, addrlen, host, hostlen, serv, servlen, flags);
+ int error = gni(addr, addrlen, host, static_cast<DWORD>(hostlen),
+ serv, static_cast<DWORD>(servlen), flags);
       return ec = translate_addrinfo_error(error);
     }
   }

Modified: branches/fix-links/boost/asio/detail/socket_types.hpp
==============================================================================
--- branches/fix-links/boost/asio/detail/socket_types.hpp (original)
+++ branches/fix-links/boost/asio/detail/socket_types.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -92,7 +92,7 @@
 # include <sys/ioctl.h>
 # include <sys/poll.h>
 # include <sys/types.h>
-# if defined(__hpux)
+# if defined(__hpux) && !defined(__HP_aCC)
 # include <sys/time.h>
 # else
 # include <sys/select.h>

Modified: branches/fix-links/boost/asio/detail/win_iocp_io_service.hpp
==============================================================================
--- branches/fix-links/boost/asio/detail/win_iocp_io_service.hpp (original)
+++ branches/fix-links/boost/asio/detail/win_iocp_io_service.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -34,7 +34,6 @@
 #include <boost/asio/detail/service_base.hpp>
 #include <boost/asio/detail/socket_types.hpp>
 #include <boost/asio/detail/timer_queue.hpp>
-#include <boost/asio/detail/win_iocp_operation.hpp>
 #include <boost/asio/detail/mutex.hpp>
 
 namespace boost {
@@ -45,14 +44,64 @@
   : public boost::asio::detail::service_base<win_iocp_io_service>
 {
 public:
- // Base class for all operations.
- typedef win_iocp_operation operation;
+ // Base class for all operations. A function pointer is used instead of
+ // virtual functions to avoid the associated overhead.
+ //
+ // This class inherits from OVERLAPPED so that we can downcast to get back to
+ // the operation pointer from the LPOVERLAPPED out parameter of
+ // GetQueuedCompletionStatus.
+ class operation
+ : public OVERLAPPED
+ {
+ public:
+ typedef void (*invoke_func_type)(operation*, DWORD, size_t);
+ typedef void (*destroy_func_type)(operation*);
+
+ operation(win_iocp_io_service& iocp_service,
+ invoke_func_type invoke_func, destroy_func_type destroy_func)
+ : outstanding_operations_(&iocp_service.outstanding_operations_),
+ invoke_func_(invoke_func),
+ destroy_func_(destroy_func)
+ {
+ Internal = 0;
+ InternalHigh = 0;
+ Offset = 0;
+ OffsetHigh = 0;
+ hEvent = 0;
+
+ ::InterlockedIncrement(outstanding_operations_);
+ }
+
+ void do_completion(DWORD last_error, size_t bytes_transferred)
+ {
+ invoke_func_(this, last_error, bytes_transferred);
+ }
+
+ void destroy()
+ {
+ destroy_func_(this);
+ }
+
+ protected:
+ // Prevent deletion through this type.
+ ~operation()
+ {
+ ::InterlockedDecrement(outstanding_operations_);
+ }
+
+ private:
+ long* outstanding_operations_;
+ invoke_func_type invoke_func_;
+ destroy_func_type destroy_func_;
+ };
+
 
   // Constructor.
   win_iocp_io_service(boost::asio::io_service& io_service)
     : boost::asio::detail::service_base<win_iocp_io_service>(io_service),
       iocp_(),
       outstanding_work_(0),
+ outstanding_operations_(0),
       stopped_(0),
       shutdown_(0),
       timer_thread_(0),
@@ -80,7 +129,7 @@
   {
     ::InterlockedExchange(&shutdown_, 1);
 
- for (;;)
+ while (::InterlockedExchangeAdd(&outstanding_operations_, 0) > 0)
     {
       DWORD bytes_transferred = 0;
 #if (WINVER < 0x0500)
@@ -89,12 +138,8 @@
       DWORD_PTR completion_key = 0;
 #endif
       LPOVERLAPPED overlapped = 0;
- ::SetLastError(0);
- BOOL ok = ::GetQueuedCompletionStatus(iocp_.handle,
- &bytes_transferred, &completion_key, &overlapped, 0);
- DWORD last_error = ::GetLastError();
- if (!ok && overlapped == 0 && last_error == WAIT_TIMEOUT)
- break;
+ ::GetQueuedCompletionStatus(iocp_.handle, &bytes_transferred,
+ &completion_key, &overlapped, INFINITE);
       if (overlapped)
         static_cast<operation*>(overlapped)->destroy();
     }
@@ -250,7 +295,7 @@
   }
 
   // Request invocation of the given OVERLAPPED-derived operation.
- void post_completion(win_iocp_operation* op, DWORD op_last_error,
+ void post_completion(operation* op, DWORD op_last_error,
       DWORD bytes_transferred)
   {
     // Enqueue the operation on the I/O completion port.
@@ -348,7 +393,7 @@
             &timer_thread_, this_thread_id, 0) == 0);
 
       // Calculate timeout for GetQueuedCompletionStatus call.
- DWORD timeout = max_timeout;
+ DWORD timeout = INFINITE;
       if (dispatching_timers)
       {
         boost::asio::detail::mutex::scoped_lock lock(timer_mutex_);
@@ -372,13 +417,28 @@
       // Dispatch any pending timers.
       if (dispatching_timers)
       {
- boost::asio::detail::mutex::scoped_lock lock(timer_mutex_);
- timer_queues_copy_ = timer_queues_;
- for (std::size_t i = 0; i < timer_queues_.size(); ++i)
+ try
         {
- timer_queues_[i]->dispatch_timers();
- timer_queues_[i]->dispatch_cancellations();
- timer_queues_[i]->cleanup_timers();
+ boost::asio::detail::mutex::scoped_lock lock(timer_mutex_);
+ timer_queues_copy_ = timer_queues_;
+ for (std::size_t i = 0; i < timer_queues_.size(); ++i)
+ {
+ timer_queues_[i]->dispatch_timers();
+ timer_queues_[i]->dispatch_cancellations();
+ timer_queues_[i]->cleanup_timers();
+ }
+ }
+ catch (...)
+ {
+ // Transfer responsibility for dispatching timers to another thread.
+ if (::InterlockedCompareExchange(&timer_thread_,
+ 0, this_thread_id) == this_thread_id)
+ {
+ ::PostQueuedCompletionStatus(iocp_.handle,
+ 0, transfer_timer_dispatching, 0);
+ }
+
+ throw;
         }
       }
 
@@ -533,7 +593,7 @@
   {
     handler_operation(win_iocp_io_service& io_service,
         Handler handler)
- : operation(&handler_operation<Handler>::do_completion_impl,
+ : operation(io_service, &handler_operation<Handler>::do_completion_impl,
           &handler_operation<Handler>::destroy_impl),
         io_service_(io_service),
         handler_(handler)
@@ -594,6 +654,10 @@
   // The count of unfinished work.
   long outstanding_work_;
 
+ // The count of unfinished operations.
+ long outstanding_operations_;
+ friend class operation;
+
   // Flag to indicate whether the event loop has been stopped.
   long stopped_;
 
@@ -603,7 +667,7 @@
   enum
   {
     // Maximum GetQueuedCompletionStatus timeout, in milliseconds.
- max_timeout = 1000,
+ max_timeout = 500,
 
     // Completion key value to indicate that responsibility for dispatching
     // timers is being cooperatively transferred from one thread to another.

Deleted: branches/fix-links/boost/asio/detail/win_iocp_operation.hpp
==============================================================================
--- branches/fix-links/boost/asio/detail/win_iocp_operation.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
+++ (empty file)
@@ -1,83 +0,0 @@
-//
-// win_iocp_operation.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2007 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-#ifndef BOOST_ASIO_DETAIL_WIN_IOCP_OPERATION_HPP
-#define BOOST_ASIO_DETAIL_WIN_IOCP_OPERATION_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include <boost/asio/detail/push_options.hpp>
-
-#include <boost/asio/detail/win_iocp_io_service_fwd.hpp>
-
-#if defined(BOOST_ASIO_HAS_IOCP)
-
-#include <boost/asio/detail/socket_types.hpp>
-
-namespace boost {
-namespace asio {
-namespace detail {
-
-// Base class for all IOCP operations. A function pointer is used instead of
-// virtual functions to avoid the associated overhead.
-//
-// This class inherits from OVERLAPPED so that we can downcast to get back to
-// the win_iocp_operation pointer from the LPOVERLAPPED out parameter of
-// GetQueuedCompletionStatus.
-struct win_iocp_operation
- : public OVERLAPPED
-{
- typedef void (*invoke_func_type)(win_iocp_operation*, DWORD, size_t);
- typedef void (*destroy_func_type)(win_iocp_operation*);
-
- win_iocp_operation(invoke_func_type invoke_func,
- destroy_func_type destroy_func)
- : invoke_func_(invoke_func),
- destroy_func_(destroy_func)
- {
- Internal = 0;
- InternalHigh = 0;
- Offset = 0;
- OffsetHigh = 0;
- hEvent = 0;
- }
-
- void do_completion(DWORD last_error, size_t bytes_transferred)
- {
- invoke_func_(this, last_error, bytes_transferred);
- }
-
- void destroy()
- {
- destroy_func_(this);
- }
-
-protected:
- // Prevent deletion through this type.
- ~win_iocp_operation()
- {
- }
-
-private:
- invoke_func_type invoke_func_;
- destroy_func_type destroy_func_;
-};
-
-} // namespace detail
-} // namespace asio
-} // namespace boost
-
-#endif // defined(BOOST_ASIO_HAS_IOCP)
-
-#include <boost/asio/detail/pop_options.hpp>
-
-#endif // BOOST_ASIO_DETAIL_WIN_IOCP_OPERATION_HPP

Modified: branches/fix-links/boost/asio/detail/win_iocp_socket_service.hpp
==============================================================================
--- branches/fix-links/boost/asio/detail/win_iocp_socket_service.hpp (original)
+++ branches/fix-links/boost/asio/detail/win_iocp_socket_service.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -57,7 +57,7 @@
   typedef typename Protocol::endpoint endpoint_type;
 
   // Base class for all operations.
- typedef win_iocp_operation operation;
+ typedef win_iocp_io_service::operation operation;
 
   struct noop_deleter { void operator()(void*) {} };
   typedef boost::shared_ptr<void> shared_cancel_token_type;
@@ -681,13 +681,13 @@
     : public operation
   {
   public:
- send_operation(boost::asio::io_service& io_service,
+ send_operation(win_iocp_io_service& io_service,
         weak_cancel_token_type cancel_token,
         const ConstBufferSequence& buffers, Handler handler)
- : operation(
+ : operation(io_service,
           &send_operation<ConstBufferSequence, Handler>::do_completion_impl,
           &send_operation<ConstBufferSequence, Handler>::destroy_impl),
- work_(io_service),
+ work_(io_service.get_io_service()),
         cancel_token_(cancel_token),
         buffers_(buffers),
         handler_(handler)
@@ -783,8 +783,8 @@
     typedef send_operation<ConstBufferSequence, Handler> value_type;
     typedef handler_alloc_traits<Handler, value_type> alloc_traits;
     raw_handler_ptr<alloc_traits> raw_ptr(handler);
- handler_ptr<alloc_traits> ptr(raw_ptr,
- this->get_io_service(), impl.cancel_token_, buffers, handler);
+ handler_ptr<alloc_traits> ptr(raw_ptr, iocp_service_,
+ impl.cancel_token_, buffers, handler);
 
     // Copy buffers into WSABUF array.
     ::WSABUF bufs[max_buffers];
@@ -861,7 +861,7 @@
     // Send the data.
     DWORD bytes_transferred = 0;
     int result = ::WSASendTo(impl.socket_, bufs, i, &bytes_transferred,
- flags, destination.data(), destination.size(), 0, 0);
+ flags, destination.data(), static_cast<int>(destination.size()), 0, 0);
     if (result != 0)
     {
       DWORD last_error = ::WSAGetLastError();
@@ -881,12 +881,12 @@
     : public operation
   {
   public:
- send_to_operation(boost::asio::io_service& io_service,
+ send_to_operation(win_iocp_io_service& io_service,
         const ConstBufferSequence& buffers, Handler handler)
- : operation(
+ : operation(io_service,
           &send_to_operation<ConstBufferSequence, Handler>::do_completion_impl,
           &send_to_operation<ConstBufferSequence, Handler>::destroy_impl),
- work_(io_service),
+ work_(io_service.get_io_service()),
         buffers_(buffers),
         handler_(handler)
     {
@@ -974,8 +974,7 @@
     typedef send_to_operation<ConstBufferSequence, Handler> value_type;
     typedef handler_alloc_traits<Handler, value_type> alloc_traits;
     raw_handler_ptr<alloc_traits> raw_ptr(handler);
- handler_ptr<alloc_traits> ptr(raw_ptr,
- this->get_io_service(), buffers, handler);
+ handler_ptr<alloc_traits> ptr(raw_ptr, iocp_service_, buffers, handler);
 
     // Copy buffers into WSABUF array.
     ::WSABUF bufs[max_buffers];
@@ -992,8 +991,8 @@
 
     // Send the data.
     DWORD bytes_transferred = 0;
- int result = ::WSASendTo(impl.socket_, bufs, i, &bytes_transferred,
- flags, destination.data(), destination.size(), ptr.get(), 0);
+ int result = ::WSASendTo(impl.socket_, bufs, i, &bytes_transferred, flags,
+ destination.data(), static_cast<int>(destination.size()), ptr.get(), 0);
     DWORD last_error = ::WSAGetLastError();
 
     // Check if the operation completed immediately.
@@ -1075,15 +1074,15 @@
     : public operation
   {
   public:
- receive_operation(boost::asio::io_service& io_service,
+ receive_operation(win_iocp_io_service& io_service,
         weak_cancel_token_type cancel_token,
         const MutableBufferSequence& buffers, Handler handler)
- : operation(
+ : operation(io_service,
           &receive_operation<
             MutableBufferSequence, Handler>::do_completion_impl,
           &receive_operation<
             MutableBufferSequence, Handler>::destroy_impl),
- work_(io_service),
+ work_(io_service.get_io_service()),
         cancel_token_(cancel_token),
         buffers_(buffers),
         handler_(handler)
@@ -1186,8 +1185,8 @@
     typedef receive_operation<MutableBufferSequence, Handler> value_type;
     typedef handler_alloc_traits<Handler, value_type> alloc_traits;
     raw_handler_ptr<alloc_traits> raw_ptr(handler);
- handler_ptr<alloc_traits> ptr(raw_ptr,
- this->get_io_service(), impl.cancel_token_, buffers, handler);
+ handler_ptr<alloc_traits> ptr(raw_ptr, iocp_service_,
+ impl.cancel_token_, buffers, handler);
 
     // Copy buffers into WSABUF array.
     ::WSABUF bufs[max_buffers];
@@ -1291,17 +1290,17 @@
     : public operation
   {
   public:
- receive_from_operation(boost::asio::io_service& io_service,
+ receive_from_operation(win_iocp_io_service& io_service,
         endpoint_type& endpoint, const MutableBufferSequence& buffers,
         Handler handler)
- : operation(
+ : operation(io_service,
           &receive_from_operation<
             MutableBufferSequence, Handler>::do_completion_impl,
           &receive_from_operation<
             MutableBufferSequence, Handler>::destroy_impl),
         endpoint_(endpoint),
         endpoint_size_(static_cast<int>(endpoint.capacity())),
- work_(io_service),
+ work_(io_service.get_io_service()),
         buffers_(buffers),
         handler_(handler)
     {
@@ -1406,8 +1405,8 @@
     typedef receive_from_operation<MutableBufferSequence, Handler> value_type;
     typedef handler_alloc_traits<Handler, value_type> alloc_traits;
     raw_handler_ptr<alloc_traits> raw_ptr(handler);
- handler_ptr<alloc_traits> ptr(raw_ptr,
- this->get_io_service(), sender_endp, buffers, handler);
+ handler_ptr<alloc_traits> ptr(raw_ptr, iocp_service_,
+ sender_endp, buffers, handler);
 
     // Copy buffers into WSABUF array.
     ::WSABUF bufs[max_buffers];
@@ -1509,7 +1508,7 @@
         socket_type socket, socket_type new_socket, Socket& peer,
         const protocol_type& protocol, endpoint_type* peer_endpoint,
         bool enable_connection_aborted, Handler handler)
- : operation(
+ : operation(io_service,
           &accept_operation<Socket, Handler>::do_completion_impl,
           &accept_operation<Socket, Handler>::destroy_impl),
         io_service_(io_service),

Modified: branches/fix-links/boost/asio/error.hpp
==============================================================================
--- branches/fix-links/boost/asio/error.hpp (original)
+++ branches/fix-links/boost/asio/error.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -71,6 +71,11 @@
   /// Operation already in progress.
   already_started = BOOST_ASIO_SOCKET_ERROR(EALREADY),
 
+ /// Broken pipe.
+ broken_pipe = BOOST_ASIO_WIN_OR_POSIX(
+ BOOST_ASIO_NATIVE_ERROR(ERROR_BROKEN_PIPE),
+ BOOST_ASIO_NATIVE_ERROR(EPIPE)),
+
   /// A connection has been aborted.
   connection_aborted = BOOST_ASIO_SOCKET_ERROR(ECONNABORTED),
 

Modified: branches/fix-links/boost/asio/ssl/detail/openssl_init.hpp
==============================================================================
--- branches/fix-links/boost/asio/ssl/detail/openssl_init.hpp (original)
+++ branches/fix-links/boost/asio/ssl/detail/openssl_init.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -20,10 +20,12 @@
 
 #include <boost/asio/detail/push_options.hpp>
 #include <vector>
+#include <boost/assert.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/asio/detail/pop_options.hpp>
 
 #include <boost/asio/detail/mutex.hpp>
+#include <boost/asio/detail/tss_ptr.hpp>
 #include <boost/asio/ssl/detail/openssl_types.hpp>
 
 namespace boost {
@@ -52,6 +54,7 @@
         for (size_t i = 0; i < mutexes_.size(); ++i)
           mutexes_[i].reset(new boost::asio::detail::mutex);
         ::CRYPTO_set_locking_callback(&do_init::openssl_locking_func);
+ ::CRYPTO_set_id_callback(&do_init::openssl_id_func);
       }
     }
 
@@ -59,6 +62,7 @@
     {
       if (Do_Init)
       {
+ ::CRYPTO_set_id_callback(0);
         ::CRYPTO_set_locking_callback(0);
         ::ERR_free_strings();
         ::ERR_remove_state(0);
@@ -81,6 +85,15 @@
     }
 
   private:
+ static unsigned long openssl_id_func()
+ {
+ void* id = instance()->thread_id_;
+ if (id == 0)
+ instance()->thread_id_ = id = &id; // Ugh.
+ BOOST_ASSERT(sizeof(unsigned long) >= sizeof(void*));
+ return reinterpret_cast<unsigned long>(id);
+ }
+
     static void openssl_locking_func(int mode, int n,
       const char *file, int line)
     {
@@ -92,6 +105,9 @@
 
     // Mutexes to be used in locking callbacks.
     std::vector<boost::shared_ptr<boost::asio::detail::mutex> > mutexes_;
+
+ // The thread identifiers to be used by openssl.
+ boost::asio::detail::tss_ptr<void> thread_id_;
   };
 
 public:

Modified: branches/fix-links/boost/asio/ssl/detail/openssl_operation.hpp
==============================================================================
--- branches/fix-links/boost/asio/ssl/detail/openssl_operation.hpp (original)
+++ branches/fix-links/boost/asio/ssl/detail/openssl_operation.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -19,6 +19,7 @@
 
 #include <boost/asio/detail/push_options.hpp>
 #include <boost/function.hpp>
+#include <boost/assert.hpp>
 #include <boost/bind.hpp>
 #include <boost/asio/detail/pop_options.hpp>
 
@@ -88,10 +89,12 @@
                     net_buffer& recv_buf,
                     SSL* session,
                     BIO* ssl_bio,
- user_handler_func handler
+ user_handler_func handler,
+ boost::asio::io_service::strand& strand
                     )
     : primitive_(primitive)
     , user_handler_(handler)
+ , strand_(&strand)
     , recv_buf_(recv_buf)
     , socket_(socket)
     , ssl_bio_(ssl_bio)
@@ -118,6 +121,7 @@
                     SSL* session,
                     BIO* ssl_bio)
     : primitive_(primitive)
+ , strand_(0)
     , recv_buf_(recv_buf)
     , socket_(socket)
     , ssl_bio_(ssl_bio)
@@ -241,6 +245,7 @@
 
   ssl_primitive_func primitive_;
   user_handler_func user_handler_;
+ boost::asio::io_service::strand* strand_;
   write_func write_;
   read_func read_;
   int_handler_func handler_;
@@ -304,19 +309,23 @@
       {
         unsigned char *data_start = send_buf_.get_unused_start();
         send_buf_.data_added(len);
-
+
+ BOOST_ASSERT(strand_);
         boost::asio::async_write
         (
           socket_,
           boost::asio::buffer(data_start, len),
- boost::bind
+ strand_->wrap
           (
- &openssl_operation::async_write_handler,
- this,
- is_operation_done,
- rc,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred
+ boost::bind
+ (
+ &openssl_operation::async_write_handler,
+ this,
+ is_operation_done,
+ rc,
+ boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred
+ )
           )
         );
                   
@@ -366,17 +375,21 @@
   int do_async_read()
   {
     // Wait for new data
+ BOOST_ASSERT(strand_);
     socket_.async_read_some
     (
       boost::asio::buffer(recv_buf_.get_unused_start(),
         recv_buf_.get_unused_len()),
- boost::bind
+ strand_->wrap
       (
- &openssl_operation::async_read_handler,
- this,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred
- )
+ boost::bind
+ (
+ &openssl_operation::async_read_handler,
+ this,
+ boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred
+ )
+ )
     );
     return 0;
   }

Modified: branches/fix-links/boost/asio/ssl/detail/openssl_stream_service.hpp
==============================================================================
--- branches/fix-links/boost/asio/ssl/detail/openssl_stream_service.hpp (original)
+++ branches/fix-links/boost/asio/ssl/detail/openssl_stream_service.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -20,6 +20,7 @@
 
 #include <boost/asio/detail/push_options.hpp>
 #include <cstddef>
+#include <climits>
 #include <boost/config.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/function.hpp>
@@ -28,6 +29,7 @@
 
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
+#include <boost/asio/strand.hpp>
 #include <boost/asio/detail/service_base.hpp>
 #include <boost/asio/ssl/basic_context.hpp>
 #include <boost/asio/ssl/stream_base.hpp>
@@ -43,6 +45,8 @@
   : public boost::asio::detail::service_base<openssl_stream_service>
 {
 private:
+ enum { max_buffer_size = INT_MAX };
+
   //Base handler for asyncrhonous operations
   template <typename Stream>
   class base_handler
@@ -161,7 +165,8 @@
 
   // Construct a new stream socket service for the specified io_service.
   explicit openssl_stream_service(boost::asio::io_service& io_service)
- : boost::asio::detail::service_base<openssl_stream_service>(io_service)
+ : boost::asio::detail::service_base<openssl_stream_service>(io_service),
+ strand_(io_service)
   {
   }
 
@@ -256,11 +261,12 @@
         local_handler,
         boost::arg<1>(),
         boost::arg<2>()
- )
+ ),
+ strand_
     );
     local_handler->set_operation(op);
 
- get_io_service().post(boost::bind(&openssl_operation<Stream>::start, op));
+ strand_.post(boost::bind(&openssl_operation<Stream>::start, op));
   }
 
   // Shut down SSL on the stream.
@@ -310,11 +316,12 @@
         local_handler,
         boost::arg<1>(),
         boost::arg<2>()
- )
+ ),
+ strand_
     );
     local_handler->set_operation(op);
 
- get_io_service().post(boost::bind(&openssl_operation<Stream>::start, op));
+ strand_.post(boost::bind(&openssl_operation<Stream>::start, op));
   }
 
   // Write some data to the stream.
@@ -325,10 +332,14 @@
     size_t bytes_transferred = 0;
     try
     {
+ std::size_t buffer_size = boost::asio::buffer_size(*buffers.begin());
+ if (buffer_size > max_buffer_size)
+ buffer_size = max_buffer_size;
+
       boost::function<int (SSL*)> send_func =
         boost::bind(&::SSL_write, boost::arg<1>(),
             boost::asio::buffer_cast<const void*>(*buffers.begin()),
- static_cast<int>(boost::asio::buffer_size(*buffers.begin())));
+ static_cast<int>(buffer_size));
       openssl_operation<Stream> op(
         send_func,
         next_layer,
@@ -357,10 +368,14 @@
 
     send_handler* local_handler = new send_handler(handler, get_io_service());
 
+ std::size_t buffer_size = boost::asio::buffer_size(*buffers.begin());
+ if (buffer_size > max_buffer_size)
+ buffer_size = max_buffer_size;
+
     boost::function<int (SSL*)> send_func =
       boost::bind(&::SSL_write, boost::arg<1>(),
           boost::asio::buffer_cast<const void*>(*buffers.begin()),
- static_cast<int>(boost::asio::buffer_size(*buffers.begin())));
+ static_cast<int>(buffer_size));
 
     openssl_operation<Stream>* op = new openssl_operation<Stream>
     (
@@ -375,11 +390,12 @@
         local_handler,
         boost::arg<1>(),
         boost::arg<2>()
- )
+ ),
+ strand_
     );
     local_handler->set_operation(op);
 
- get_io_service().post(boost::bind(&openssl_operation<Stream>::start, op));
+ strand_.post(boost::bind(&openssl_operation<Stream>::start, op));
   }
 
   // Read some data from the stream.
@@ -390,10 +406,14 @@
     size_t bytes_transferred = 0;
     try
     {
+ std::size_t buffer_size = boost::asio::buffer_size(*buffers.begin());
+ if (buffer_size > max_buffer_size)
+ buffer_size = max_buffer_size;
+
       boost::function<int (SSL*)> recv_func =
         boost::bind(&::SSL_read, boost::arg<1>(),
             boost::asio::buffer_cast<void*>(*buffers.begin()),
- boost::asio::buffer_size(*buffers.begin()));
+ static_cast<int>(buffer_size));
       openssl_operation<Stream> op(recv_func,
         next_layer,
         impl->recv_buf,
@@ -422,10 +442,14 @@
 
     recv_handler* local_handler = new recv_handler(handler, get_io_service());
 
+ std::size_t buffer_size = boost::asio::buffer_size(*buffers.begin());
+ if (buffer_size > max_buffer_size)
+ buffer_size = max_buffer_size;
+
     boost::function<int (SSL*)> recv_func =
       boost::bind(&::SSL_read, boost::arg<1>(),
           boost::asio::buffer_cast<void*>(*buffers.begin()),
- boost::asio::buffer_size(*buffers.begin()));
+ static_cast<int>(buffer_size));
 
     openssl_operation<Stream>* op = new openssl_operation<Stream>
     (
@@ -440,11 +464,12 @@
         local_handler,
         boost::arg<1>(),
         boost::arg<2>()
- )
+ ),
+ strand_
     );
     local_handler->set_operation(op);
 
- get_io_service().post(boost::bind(&openssl_operation<Stream>::start, op));
+ strand_.post(boost::bind(&openssl_operation<Stream>::start, op));
   }
 
   // Peek at the incoming data on the stream.
@@ -466,6 +491,8 @@
   }
 
 private:
+ boost::asio::io_service::strand strand_;
+
   typedef boost::asio::detail::mutex mutex_type;
   
   template<typename Mutex>

Modified: branches/fix-links/boost/config/compiler/intel.hpp
==============================================================================
--- branches/fix-links/boost/config/compiler/intel.hpp (original)
+++ branches/fix-links/boost/config/compiler/intel.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,4 +1,4 @@
-// (C) Copyright John Maddock 2001-7.
+// (C) Copyright John Maddock 2001-8.
 // (C) Copyright Peter Dimov 2001.
 // (C) Copyright Jens Maurer 2001.
 // (C) Copyright David Abrahams 2002 - 2003.
@@ -148,16 +148,15 @@
 #endif
 //
 // last known and checked version:
-#if (BOOST_INTEL_CXX_VERSION > 1000)
+#if (BOOST_INTEL_CXX_VERSION > 1010)
 # if defined(BOOST_ASSERT_CONFIG)
 # error "Unknown compiler version - please run the configure tests and report the results"
 # elif defined(_MSC_VER)
-# pragma message("Unknown compiler version - please run the configure tests and report the results")
+//
+// We don't emit this warning any more, since we have so few
+// defect macros set anyway (just the one).
+//
+//# pragma message("Unknown compiler version - please run the configure tests and report the results")
 # endif
 #endif
 
-
-
-
-
-

Modified: branches/fix-links/boost/config/compiler/vacpp.hpp
==============================================================================
--- branches/fix-links/boost/config/compiler/vacpp.hpp (original)
+++ branches/fix-links/boost/config/compiler/vacpp.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,7 +1,7 @@
 // (C) Copyright John Maddock 2001 - 2003.
 // (C) Copyright Toon Knapen 2001 - 2003.
 // (C) Copyright Lie-Quan Lee 2001.
-// (C) Copyright Markus Schöpflin 2002 - 2003.
+// (C) Copyright Markus Schoepflin 2002 - 2003.
 // (C) Copyright Beman Dawes 2002 - 2003.
 // Use, modification and distribution are subject to the
 // Boost Software License, Version 1.0. (See accompanying file

Modified: branches/fix-links/boost/config/platform/hpux.hpp
==============================================================================
--- branches/fix-links/boost/config/platform/hpux.hpp (original)
+++ branches/fix-links/boost/config/platform/hpux.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -23,6 +23,8 @@
 
 #if !(defined(__HP_aCC) || !defined(_INCLUDE__STDC_A1_SOURCE))
 # define BOOST_NO_SWPRINTF
+#endif
+#if defined(__HP_aCC) && !defined(_INCLUDE__STDC_A1_SOURCE)
 # define BOOST_NO_CWCTYPE
 #endif
 
@@ -82,3 +84,4 @@
 #ifndef BOOST_HAS_EXPM1
 # define BOOST_HAS_EXPM1
 #endif
+

Modified: branches/fix-links/boost/function_types/components.hpp
==============================================================================
--- branches/fix-links/boost/function_types/components.hpp (original)
+++ branches/fix-links/boost/function_types/components.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -120,13 +120,14 @@
     template
     < typename Components
     , typename IfTagged
- , typename ThenTag
+ , typename ThenTag
+ , typename DefaultBase = components_non_func_base
>
     struct retagged_if
       : mpl::if_
         < detail::represents_impl<Components, IfTagged>
         , detail::changed_tag<Components,IfTagged,ThenTag>
- , components_non_func_base
+ , DefaultBase
>::type
     { };
 
@@ -213,14 +214,71 @@
       : components_impl<T,L>
     { };
 
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x565))
+
+ template<typename T, class C>
+ struct member_obj_ptr_result
+ { typedef T & type; };
+
+ template<typename T, class C>
+ struct member_obj_ptr_result<T, C const>
+ { typedef T const & type; };
+
+ template<typename T, class C>
+ struct member_obj_ptr_result<T, C volatile>
+ { typedef T volatile & type; };
+
+ template<typename T, class C>
+ struct member_obj_ptr_result<T, C const volatile>
+ { typedef T const volatile & type; };
+
+ template<typename T, class C>
+ struct member_obj_ptr_result<T &, C>
+ { typedef T & type; };
+
+ template<typename T, class C>
+ struct member_obj_ptr_result<T &, C const>
+ { typedef T & type; };
+
+ template<typename T, class C>
+ struct member_obj_ptr_result<T &, C volatile>
+ { typedef T & type; };
+
+ template<typename T, class C>
+ struct member_obj_ptr_result<T &, C const volatile>
+ { typedef T & type; };
+
+ template<typename T, class C, typename L>
+ struct member_obj_ptr_components
+ : member_object_pointer_base
+ {
+ typedef function_types::components<T C::*, L> type;
+ typedef components_mpl_sequence_tag tag;
+
+ typedef mpl::integral_c<std::size_t,1> function_arity;
+
+ typedef mpl::vector2< typename detail::member_obj_ptr_result<T,C>::type,
+ typename detail::class_transform<C,L>::type > types;
+ };
+
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x565))
+# define BOOST_FT_variations BOOST_FT_pointer|BOOST_FT_member_pointer
+
+ template<typename T, class C, typename L>
+ struct components_impl<T C::*, L>
+ : member_obj_ptr_components<T,C,L>
+ { };
+
+#else
+# define BOOST_FT_variations BOOST_FT_pointer
+
     // This workaround removes the member pointer from the type to allow
     // detection of member function pointers with BCC.
     template<typename T, typename C, typename L>
     struct components_impl<T C::*, L>
       : detail::retagged_if
         < detail::components_impl<typename boost::remove_cv<T>::type *, L>
- , pointer_tag, /* --> */ member_pointer_tag >
+ , pointer_tag, /* --> */ member_function_pointer_tag
+ , member_obj_ptr_components<T,C,L> >
     { };
 
     // BCC lets us test the cv-qualification of a function type by template
@@ -349,65 +407,13 @@
     struct components_bcc
       : mpl::if_
         < detail::represents_impl< detail::components_impl<T,L>
- , member_pointer_tag>
+ , member_function_pointer_tag>
         , detail::mfp_components<detail::components_impl<T,L>,T,OrigT,L>
         , detail::components_impl<T,L>
>::type
     { };
 
-// TODO: add data member support for Borland
-
-# define BOOST_FT_variations BOOST_FT_pointer
-#else // end of BORLAND WORKAROUND
-# define BOOST_FT_variations BOOST_FT_pointer|BOOST_FT_member_pointer
-
- template<typename T, class C>
- struct member_obj_ptr_result
- { typedef T & type; };
-
- template<typename T, class C>
- struct member_obj_ptr_result<T, C const>
- { typedef T const & type; };
-
- template<typename T, class C>
- struct member_obj_ptr_result<T, C volatile>
- { typedef T volatile & type; };
-
- template<typename T, class C>
- struct member_obj_ptr_result<T, C const volatile>
- { typedef T const volatile & type; };
-
- template<typename T, class C>
- struct member_obj_ptr_result<T &, C>
- { typedef T & type; };
-
- template<typename T, class C>
- struct member_obj_ptr_result<T &, C const>
- { typedef T & type; };
-
- template<typename T, class C>
- struct member_obj_ptr_result<T &, C volatile>
- { typedef T & type; };
-
- template<typename T, class C>
- struct member_obj_ptr_result<T &, C const volatile>
- { typedef T & type; };
-
-
- template<typename T, class C, typename L>
- struct components_impl<T C::*, L>
- : member_object_pointer_base
- {
- typedef function_types::components<T C::*, L> type;
- typedef components_mpl_sequence_tag tag;
-
- typedef mpl::integral_c<std::size_t,1> function_arity;
-
- typedef mpl::vector2< typename detail::member_obj_ptr_result<T,C>::type,
- typename detail::class_transform<C,L>::type > types;
- };
-
-#endif
+#endif // end of BORLAND WORKAROUND
 
 #define BOOST_FT_al_path boost/function_types/detail/components_impl
 #include <boost/function_types/detail/pp_loop.hpp>

Modified: branches/fix-links/boost/function_types/detail/cv_traits.hpp
==============================================================================
--- branches/fix-links/boost/function_types/detail/cv_traits.hpp (original)
+++ branches/fix-links/boost/function_types/detail/cv_traits.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -12,7 +12,7 @@
 #include <cstddef>
 #include <boost/detail/workaround.hpp>
 
-#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || BOOST_WORKAROUND(__BORLANDC__, <= 0x582)
 # include <boost/type_traits/remove_cv.hpp>
 # include <boost/type_traits/remove_pointer.hpp>
 # include <boost/type_traits/remove_reference.hpp>
@@ -25,7 +25,7 @@
 namespace ft = boost::function_types;
 
 
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__BORLANDC__, <= 0x582)
 
 template<typename T> struct cv_traits
 { typedef non_cv tag; typedef T type; };

Modified: branches/fix-links/boost/functional/detail/hash_float.hpp
==============================================================================
--- branches/fix-links/boost/functional/detail/hash_float.hpp (original)
+++ branches/fix-links/boost/functional/detail/hash_float.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -38,7 +38,7 @@
 
 // STLport
 #elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
-// _fpclass and fpclassify aren't good enough on STLport.
+// fpclassify aren't good enough on STLport.
 
 // GNU libstdc++ 3
 #elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
@@ -50,12 +50,7 @@
 // Dinkumware Library, on Visual C++
 #elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
 
-// Not using _fpclass because it causes a warning about a conversion
-// from 'long double' to 'double'. Pity.
-//
-//# if defined(BOOST_MSVC)
-//# define BOOST_HASH_USE_FPCLASS
-//# endif
+// Not using _fpclass because it is only available for double.
 
 #endif
 
@@ -160,28 +155,6 @@
                 BOOST_ASSERT(0);
                 return 0;
             }
-#elif defined(BOOST_HASH_USE_FPCLASS)
- switch(_fpclass(v)) {
- case _FPCLASS_NZ:
- case _FPCLASS_PZ:
- return 0;
- case _FPCLASS_PINF:
- return (std::size_t)(-1);
- case _FPCLASS_NINF:
- return (std::size_t)(-2);
- case _FPCLASS_SNAN:
- case _FPCLASS_QNAN:
- return (std::size_t)(-3);
- case _FPCLASS_NN:
- case _FPCLASS_ND:
- return float_hash_impl(v);
- case _FPCLASS_PD:
- case _FPCLASS_PN:
- return float_hash_impl(v);
- default:
- BOOST_ASSERT(0);
- return 0;
- }
 #else
             return v == 0 ? 0 : float_hash_impl(v);
 #endif

Modified: branches/fix-links/boost/gil/color_base.hpp
==============================================================================
--- branches/fix-links/boost/gil/color_base.hpp (original)
+++ branches/fix-links/boost/gil/color_base.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -5,7 +5,7 @@
     Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
     http://www.boost.org/LICENSE_1_0.txt).
 
- See http://opensource.adobe.com/gil for most recent version including documentation.
+ See http://stlab.adobe.com/gil for most recent version including documentation.
 */
 
 /*************************************************************************************************/
@@ -129,7 +129,7 @@
           _v1(*memunit_advanced(semantic_at_c<1>(ptr),diff)) {}
 
     // Support for planar_pixel_reference operator[]
- Element at_c_dynamic(size_t i) const {
+ Element at_c_dynamic(std::size_t i) const {
         if (i==0) return _v0;
         return _v1;
     }
@@ -182,7 +182,7 @@
           _v2(*memunit_advanced(semantic_at_c<2>(ptr),diff)) {}
 
     // Support for planar_pixel_reference operator[]
- Element at_c_dynamic(size_t i) const {
+ Element at_c_dynamic(std::size_t i) const {
         switch (i) {
             case 0: return _v0;
             case 1: return _v1;
@@ -245,7 +245,7 @@
           _v3(*memunit_advanced(semantic_at_c<3>(ptr),diff)) {}
 
     // Support for planar_pixel_reference operator[]
- Element at_c_dynamic(size_t i) const {
+ Element at_c_dynamic(std::size_t i) const {
         switch (i) {
             case 0: return _v0;
             case 1: return _v1;
@@ -316,7 +316,7 @@
           _v4(*memunit_advanced(semantic_at_c<4>(ptr),diff)) {}
 
     // Support for planar_pixel_reference operator[]
- Element at_c_dynamic(size_t i) const {
+ Element at_c_dynamic(std::size_t i) const {
         switch (i) {
             case 0: return _v0;
             case 1: return _v1;

Modified: branches/fix-links/boost/gil/extension/io/png_io_private.hpp
==============================================================================
--- branches/fix-links/boost/gil/extension/io/png_io_private.hpp (original)
+++ branches/fix-links/boost/gil/extension/io/png_io_private.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -5,7 +5,7 @@
     Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
     http://www.boost.org/LICENSE_1_0.txt).
 
- See http://opensource.adobe.com/gil for most recent version including documentation.
+ See http://stlab.adobe.com/gil for most recent version including documentation.
 */
 /*************************************************************************************************/
 
@@ -28,7 +28,7 @@
 
 namespace detail {
 
-static const size_t PNG_BYTES_TO_CHECK = 4;
+static const std::size_t PNG_BYTES_TO_CHECK = 4;
 
 // lbourdev: These can be greatly simplified, for example:
 template <typename Cs> struct png_color_type {BOOST_STATIC_CONSTANT(int,color_type=0);};

Modified: branches/fix-links/boost/interprocess/allocators/adaptive_pool.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/allocators/adaptive_pool.hpp (original)
+++ branches/fix-links/boost/interprocess/allocators/adaptive_pool.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -25,6 +25,7 @@
 #include <boost/interprocess/detail/type_traits.hpp>
 #include <boost/interprocess/allocators/detail/adaptive_node_pool.hpp>
 #include <boost/interprocess/exceptions.hpp>
+#include <boost/interprocess/allocators/detail/allocator_common.hpp>
 #include <memory>
 #include <algorithm>
 #include <cstddef>
@@ -35,35 +36,38 @@
 namespace boost {
 namespace interprocess {
 
-//!An STL node allocator that uses a segment manager as memory
-//!source. The internal pointer type will of the same type (raw, smart) as
-//!"typename SegmentManager::void_pointer" type. This allows
-//!placing the allocator in shared memory, memory mapped-files, etc...
-//!This node allocator shares a segregated storage between all instances
-//!of adaptive_pool with equal sizeof(T) placed in the same segment
-//!group. NodesPerChunk is the number of nodes allocated at once when the allocator
-//!needs runs out of nodes. MaxFreeChunks is the number of free nodes
-//!in the adaptive node pool that will trigger the deallocation of
-template<class T, class SegmentManager, std::size_t NodesPerChunk, std::size_t MaxFreeChunks>
-class adaptive_pool
+/// @cond
+
+namespace detail{
+
+template < unsigned int Version
+ , class T
+ , class SegmentManager
+ , std::size_t NodesPerChunk
+ , std::size_t MaxFreeChunks
+ , unsigned char OverheadPercent
+ >
+class adaptive_pool_base
+ : public node_pool_allocation_impl
+ < adaptive_pool_base
+ < Version, T, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent>
+ , Version
+ , T
+ , SegmentManager
+ >
 {
    public:
    typedef typename SegmentManager::void_pointer void_pointer;
- typedef typename detail::
- pointer_to_other<void_pointer, const void>::type cvoid_pointer;
    typedef SegmentManager segment_manager;
- typedef typename detail::
- pointer_to_other<void_pointer, char>::type char_pointer;
- typedef typename SegmentManager::
- mutex_family::mutex_type mutex_type;
- typedef adaptive_pool
- <T, SegmentManager, NodesPerChunk, MaxFreeChunks> self_t;
+ typedef adaptive_pool_base
+ <Version, T, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> self_t;
    typedef detail::shared_adaptive_node_pool
- < SegmentManager, mutex_type
- , sizeof(T), NodesPerChunk, MaxFreeChunks> node_pool_t;
+ < SegmentManager, sizeof(T), NodesPerChunk, MaxFreeChunks, OverheadPercent> node_pool_t;
    typedef typename detail::
       pointer_to_other<void_pointer, node_pool_t>::type node_pool_ptr;
 
+ BOOST_STATIC_ASSERT((Version <=2));
+
    public:
    //-------
    typedef typename detail::
@@ -78,52 +82,60 @@
    typedef std::size_t size_type;
    typedef std::ptrdiff_t difference_type;
 
- //!Obtains adaptive_pool from
- //!adaptive_pool
+ typedef detail::version_type<adaptive_pool_base, Version> version;
+ typedef transform_iterator
+ < typename SegmentManager::
+ multiallocation_iterator
+ , detail::cast_functor <T> > multiallocation_iterator;
+ typedef typename SegmentManager::
+ multiallocation_chain multiallocation_chain;
+
+ //!Obtains adaptive_pool_base from
+ //!adaptive_pool_base
    template<class T2>
    struct rebind
    {
- typedef adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks> other;
+ typedef adaptive_pool_base<Version, T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
    };
 
    /// @cond
    private:
- //!Not assignable from related adaptive_pool
- template<class T2, class SegmentManager2, std::size_t N2, std::size_t F2>
- adaptive_pool& operator=
- (const adaptive_pool<T2, SegmentManager2, N2, F2>&);
+ //!Not assignable from related adaptive_pool_base
+ template<unsigned int Version2, class T2, class SegmentManager2, std::size_t N2, std::size_t F2, unsigned char O2>
+ adaptive_pool_base& operator=
+ (const adaptive_pool_base<Version2, T2, SegmentManager2, N2, F2, O2>&);
 
- //!Not assignable from other adaptive_pool
- adaptive_pool& operator=(const adaptive_pool&);
+ //!Not assignable from other adaptive_pool_base
+ adaptive_pool_base& operator=(const adaptive_pool_base&);
    /// @endcond
 
    public:
    //!Constructor from a segment manager. If not present, constructs a node
    //!pool. Increments the reference count of the associated node pool.
    //!Can throw boost::interprocess::bad_alloc
- adaptive_pool(segment_manager *segment_mngr)
- : mp_node_pool(priv_get_or_create(segment_mngr)) { }
+ adaptive_pool_base(segment_manager *segment_mngr)
+ : mp_node_pool(detail::get_or_create_node_pool<node_pool_t>(segment_mngr)) { }
 
- //!Copy constructor from other adaptive_pool. Increments the reference
+ //!Copy constructor from other adaptive_pool_base. Increments the reference
    //!count of the associated node pool. Never throws
- adaptive_pool(const adaptive_pool &other)
+ adaptive_pool_base(const adaptive_pool_base &other)
       : mp_node_pool(other.get_node_pool())
    {
       mp_node_pool->inc_ref_count();
    }
 
- //!Copy constructor from related adaptive_pool. If not present, constructs
+ //!Copy constructor from related adaptive_pool_base. If not present, constructs
    //!a node pool. Increments the reference count of the associated node pool.
    //!Can throw boost::interprocess::bad_alloc
    template<class T2>
- adaptive_pool
- (const adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks> &other)
- : mp_node_pool(priv_get_or_create(other.get_segment_manager())) { }
+ adaptive_pool_base
+ (const adaptive_pool_base<Version, T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other)
+ : mp_node_pool(detail::get_or_create_node_pool<node_pool_t>(other.get_segment_manager())) { }
 
    //!Destructor, removes node_pool_t from memory
    //!if its reference count reaches to zero. Never throws
- ~adaptive_pool()
- { priv_destroy_if_last_link(); }
+ ~adaptive_pool_base()
+ { detail::destroy_node_pool_if_last_link(detail::get_pointer(mp_node_pool)); }
 
    //!Returns a pointer to the node pool.
    //!Never throws
@@ -135,156 +147,300 @@
    segment_manager* get_segment_manager()const
    { return mp_node_pool->get_segment_manager(); }
 
+ //!Swaps allocators. Does not throw. If each allocator is placed in a
+ //!different memory segment, the result is undefined.
+ friend void swap(self_t &alloc1, self_t &alloc2)
+ { detail::do_swap(alloc1.mp_node_pool, alloc2.mp_node_pool); }
+
+ /// @cond
+ private:
+ node_pool_ptr mp_node_pool;
+ /// @endcond
+};
+
+//!Equality test for same type
+//!of adaptive_pool_base
+template<unsigned int V, class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
+bool operator==(const adaptive_pool_base<V, T, S, NodesPerChunk, F, OP> &alloc1,
+ const adaptive_pool_base<V, T, S, NodesPerChunk, F, OP> &alloc2)
+ { return alloc1.get_node_pool() == alloc2.get_node_pool(); }
+
+//!Inequality test for same type
+//!of adaptive_pool_base
+template<unsigned int V, class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
+bool operator!=(const adaptive_pool_base<V, T, S, NodesPerChunk, F, OP> &alloc1,
+ const adaptive_pool_base<V, T, S, NodesPerChunk, F, OP> &alloc2)
+ { return alloc1.get_node_pool() != alloc2.get_node_pool(); }
+
+template < class T
+ , class SegmentManager
+ , std::size_t NodesPerChunk = 64
+ , std::size_t MaxFreeChunks = 2
+ , unsigned char OverheadPercent = 5
+ >
+class adaptive_pool_v1
+ : public adaptive_pool_base
+ < 1
+ , T
+ , SegmentManager
+ , NodesPerChunk
+ , MaxFreeChunks
+ , OverheadPercent
+ >
+{
+ public:
+ typedef detail::adaptive_pool_base
+ < 1, T, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> base_t;
+
+ template<class T2>
+ struct rebind
+ {
+ typedef adaptive_pool_v1<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ };
+
+ adaptive_pool_v1(SegmentManager *segment_mngr)
+ : base_t(segment_mngr)
+ {}
+
+ template<class T2>
+ adaptive_pool_v1
+ (const adaptive_pool_v1<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other)
+ : base_t(other)
+ {}
+};
+
+} //namespace detail{
+
+/// @endcond
+
+//!An STL node allocator that uses a segment manager as memory
+//!source. The internal pointer type will of the same type (raw, smart) as
+//!"typename SegmentManager::void_pointer" type. This allows
+//!placing the allocator in shared memory, memory mapped-files, etc...
+//!
+//!This node allocator shares a segregated storage between all instances
+//!of adaptive_pool with equal sizeof(T) placed in the same segment
+//!group. NodesPerChunk is the number of nodes allocated at once when the allocator
+//!needs runs out of nodes. MaxFreeChunks is the maximum number of totally free chunks
+//!that the adaptive node pool will hold. The rest of the totally free chunks will be
+//!deallocated with the segment manager.
+//!
+//!OverheadPercent is the (approximated) maximum size overhead (1-20%) of the allocator:
+//!(memory usable for nodes / total memory allocated from the segment manager)
+template < class T
+ , class SegmentManager
+ , std::size_t NodesPerChunk
+ , std::size_t MaxFreeChunks
+ , unsigned char OverheadPercent
+ >
+class adaptive_pool
+ /// @cond
+ : public detail::adaptive_pool_base
+ < 2
+ , T
+ , SegmentManager
+ , NodesPerChunk
+ , MaxFreeChunks
+ , OverheadPercent
+ >
+ /// @endcond
+{
+
+ #ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
+ typedef detail::adaptive_pool_base
+ < 2, T, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> base_t;
+ public:
+ typedef detail::version_type<adaptive_pool, 2> version;
+
+ template<class T2>
+ struct rebind
+ {
+ typedef adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ };
+
+ adaptive_pool(SegmentManager *segment_mngr)
+ : base_t(segment_mngr)
+ {}
+
+ template<class T2>
+ adaptive_pool
+ (const adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other)
+ : base_t(other)
+ {}
+
+ #else //BOOST_INTERPROCESS_DOXYGEN_INVOKED
+ public:
+ typedef implementation_defined::segment_manager segment_manager;
+ typedef segment_manager::void_pointer void_pointer;
+ typedef implementation_defined::pointer pointer;
+ typedef implementation_defined::const_pointer const_pointer;
+ typedef T value_type;
+ typedef typename detail::add_reference
+ <value_type>::type reference;
+ typedef typename detail::add_reference
+ <const value_type>::type const_reference;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+
+ //!Obtains adaptive_pool from
+ //!adaptive_pool
+ template<class T2>
+ struct rebind
+ {
+ typedef adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ };
+
+ private:
+ //!Not assignable from
+ //!related adaptive_pool
+ template<class T2, class SegmentManager2, std::size_t N2, std::size_t F2, unsigned char OP2>
+ adaptive_pool& operator=
+ (const adaptive_pool<T2, SegmentManager2, N2, F2, OP2>&);
+
+ //!Not assignable from
+ //!other adaptive_pool
+ adaptive_pool& operator=(const adaptive_pool&);
+
+ public:
+ //!Constructor from a segment manager. If not present, constructs a node
+ //!pool. Increments the reference count of the associated node pool.
+ //!Can throw boost::interprocess::bad_alloc
+ adaptive_pool(segment_manager *segment_mngr);
+
+ //!Copy constructor from other adaptive_pool. Increments the reference
+ //!count of the associated node pool. Never throws
+ adaptive_pool(const adaptive_pool &other);
+
+ //!Copy constructor from related adaptive_pool. If not present, constructs
+ //!a node pool. Increments the reference count of the associated node pool.
+ //!Can throw boost::interprocess::bad_alloc
+ template<class T2>
+ adaptive_pool
+ (const adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other);
+
+ //!Destructor, removes node_pool_t from memory
+ //!if its reference count reaches to zero. Never throws
+ ~adaptive_pool();
+
+ //!Returns a pointer to the node pool.
+ //!Never throws
+ node_pool_t* get_node_pool() const;
+
+ //!Returns the segment manager.
+ //!Never throws
+ segment_manager* get_segment_manager()const;
+
    //!Returns the number of elements that could be allocated.
    //!Never throws
- size_type max_size() const
- { return this->get_segment_manager()->get_size()/sizeof(value_type); }
+ size_type max_size() const;
 
    //!Allocate memory for an array of count elements.
- //!Throws boost::interprocess::bad_alloc if there is no enough memory*/
- pointer allocate(size_type count, cvoid_pointer = 0)
- {
- if(count > ((size_type)-1)/sizeof(value_type))
- throw bad_alloc();
- return pointer(static_cast<T*>(mp_node_pool->allocate(count)));
- }
+ //!Throws boost::interprocess::bad_alloc if there is no enough memory
+ pointer allocate(size_type count, cvoid_pointer hint = 0);
 
    //!Deallocate allocated memory.
    //!Never throws
- void deallocate(const pointer &ptr, size_type count)
- { mp_node_pool->deallocate(detail::get_pointer(ptr), count); }
+ void deallocate(const pointer &ptr, size_type count);
 
- //!Deallocates all free chunks of the pool
- void deallocate_free_chunks()
- { mp_node_pool->deallocate_free_chunks(); }
+ //!Deallocates all free chunks
+ //!of the pool
+ void deallocate_free_chunks();
 
    //!Swaps allocators. Does not throw. If each allocator is placed in a
    //!different memory segment, the result is undefined.
- friend void swap(self_t &alloc1, self_t &alloc2)
- { detail::do_swap(alloc1.mp_node_pool, alloc2.mp_node_pool); }
-
- //These functions are obsolete. These are here to conserve
- //backwards compatibility with containers using them...
+ friend void swap(self_t &alloc1, self_t &alloc2);
 
    //!Returns address of mutable object.
    //!Never throws
- pointer address(reference value) const
- { return pointer(boost::addressof(value)); }
+ pointer address(reference value) const;
 
    //!Returns address of non mutable object.
    //!Never throws
- const_pointer address(const_reference value) const
- { return const_pointer(boost::addressof(value)); }
+ const_pointer address(const_reference value) const;
 
    //!Default construct an object.
- //!Throws if T's default constructor throws*/
- void construct(const pointer &ptr)
- { new(detail::get_pointer(ptr)) value_type; }
+ //!Throws if T's default constructor throws
+ void construct(const pointer &ptr);
 
    //!Destroys object. Throws if object's
    //!destructor throws
- void destroy(const pointer &ptr)
- { BOOST_ASSERT(ptr != 0); (*ptr).~value_type(); }
-
- /// @cond
- private:
- //!Object function that creates the node allocator if it is not created and
- //!increments reference count if it is already created
- struct get_or_create_func
- {
- typedef detail::shared_adaptive_node_pool
- <SegmentManager, mutex_type, sizeof(T), NodesPerChunk, MaxFreeChunks> node_pool_t;
-
- //!This connects or constructs the unique instance of node_pool_t
- //!Can throw boost::interprocess::bad_alloc
- void operator()()
- {
- //Find or create the node_pool_t
- mp_node_pool = mp_named_alloc->template find_or_construct
- <node_pool_t>(unique_instance)(mp_named_alloc);
- //If valid, increment link count
- if(mp_node_pool != 0)
- mp_node_pool->inc_ref_count();
- }
-
- //!Constructor. Initializes function
- //!object parameters
- get_or_create_func(segment_manager *hdr) : mp_named_alloc(hdr){}
-
- node_pool_t *mp_node_pool;
- segment_manager *mp_named_alloc;
- };
-
- //!Initialization function, creates an executes atomically the
- //!initialization object functions. Can throw boost::interprocess::bad_alloc
- node_pool_t *priv_get_or_create(segment_manager *named_alloc)
- {
- get_or_create_func func(named_alloc);
- named_alloc->atomic_func(func);
- return func.mp_node_pool;
- }
-
- //!Object function that decrements the reference count. If the count
- //!reaches to zero destroys the node allocator from memory.
- //!Never throws
- struct destroy_if_last_link_func
- {
- typedef detail::shared_adaptive_node_pool
- <SegmentManager, mutex_type,sizeof(T), NodesPerChunk, MaxFreeChunks> node_pool_t;
-
- //!Decrements reference count and destroys the object if there is no
- //!more attached allocators. Never throws
- void operator()()
- {
- //If not the last link return
- if(mp_node_pool->dec_ref_count() != 0) return;
-
- //Last link, let's destroy the segment_manager
- mp_named_alloc->template destroy<node_pool_t>(unique_instance);
- }
-
- //!Constructor. Initializes function
- //!object parameters
- destroy_if_last_link_func(segment_manager *nhdr,
- node_pool_t *phdr)
- : mp_named_alloc(nhdr), mp_node_pool(phdr){}
-
- segment_manager *mp_named_alloc;
- node_pool_t *mp_node_pool;
- };
+ void destroy(const pointer &ptr);
 
- //!Destruction function, initializes and executes destruction function
- //!object. Never throws
- void priv_destroy_if_last_link()
- {
- typedef detail::shared_adaptive_node_pool
- <SegmentManager, mutex_type,sizeof(T), NodesPerChunk, MaxFreeChunks> node_pool_t;
- //Get segment manager
- segment_manager *named_segment_mngr = this->get_segment_manager();
- //Execute destruction functor atomically
- destroy_if_last_link_func func(named_segment_mngr, detail::get_pointer(mp_node_pool));
- named_segment_mngr->atomic_func(func);
- }
-
- private:
- node_pool_ptr mp_node_pool;
- /// @endcond
+ //!Returns maximum the number of objects the previously allocated memory
+ //!pointed by p can hold. This size only works for memory allocated with
+ //!allocate, allocation_command and allocate_many.
+ size_type size(const pointer &p) const;
+
+ std::pair<pointer, bool>
+ allocation_command(allocation_type command,
+ size_type limit_size,
+ size_type preferred_size,
+ size_type &received_size, const pointer &reuse = 0);
+
+ //!Allocates many elements of size elem_size in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. The elements must be deallocated
+ //!with deallocate(...)
+ multiallocation_iterator allocate_many(size_type elem_size, std::size_t num_elements);
+
+ //!Allocates n_elements elements, each one of size elem_sizes[i]in a
+ //!contiguous chunk
+ //!of memory. The elements must be deallocated
+ multiallocation_iterator allocate_many(const size_type *elem_sizes, size_type n_elements);
+
+ //!Allocates many elements of size elem_size in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. The elements must be deallocated
+ //!with deallocate(...)
+ void deallocate_many(multiallocation_iterator it);
+
+ //!Allocates just one object. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ //!Throws boost::interprocess::bad_alloc if there is no enough memory
+ pointer allocate_one();
+
+ //!Allocates many elements of size == 1 in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ multiallocation_iterator allocate_individual(std::size_t num_elements);
+
+ //!Deallocates memory previously allocated with allocate_one().
+ //!You should never use deallocate_one to deallocate memory allocated
+ //!with other functions different from allocate_one(). Never throws
+ void deallocate_one(const pointer &p);
+
+ //!Allocates many elements of size == 1 in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ void deallocate_individual(multiallocation_iterator it);
+ #endif
 };
 
+#ifdef BOOST_INTERPROCESS_DOXYGEN_INVOKED
+
 //!Equality test for same type
 //!of adaptive_pool
-template<class T, class S, std::size_t NodesPerChunk, std::size_t F> inline
-bool operator==(const adaptive_pool<T, S, NodesPerChunk, F> &alloc1,
- const adaptive_pool<T, S, NodesPerChunk, F> &alloc2)
- { return alloc1.get_node_pool() == alloc2.get_node_pool(); }
+template<class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
+bool operator==(const adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc1,
+ const adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc2);
 
 //!Inequality test for same type
 //!of adaptive_pool
-template<class T, class S, std::size_t NodesPerChunk, std::size_t F> inline
-bool operator!=(const adaptive_pool<T, S, NodesPerChunk, F> &alloc1,
- const adaptive_pool<T, S, NodesPerChunk, F> &alloc2)
- { return alloc1.get_node_pool() != alloc2.get_node_pool(); }
+template<class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
+bool operator!=(const adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc1,
+ const adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc2);
 
+#endif
 
 } //namespace interprocess {
 } //namespace boost {

Modified: branches/fix-links/boost/interprocess/allocators/allocation_type.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/allocators/allocation_type.hpp (original)
+++ branches/fix-links/boost/interprocess/allocators/allocation_type.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/allocators/allocator.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/allocators/allocator.hpp (original)
+++ branches/fix-links/boost/interprocess/allocators/allocator.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -51,13 +51,6 @@
    /// @cond
    private:
 
- struct cast_functor
- {
- typedef typename detail::add_reference<T>::type result_type;
- result_type operator()(char &ptr) const
- { return *static_cast<T*>(static_cast<void*>(&ptr)); }
- };
-
    //Self type
    typedef allocator<T, SegmentManager> self_t;
 
@@ -108,7 +101,9 @@
    typedef transform_iterator
       < typename SegmentManager::
          multiallocation_iterator
- , cast_functor> multiallocation_iterator;
+ , detail::cast_functor <T> > multiallocation_iterator;
+ typedef typename SegmentManager::
+ multiallocation_chain multiallocation_chain;
 
    /// @endcond
 
@@ -146,7 +141,7 @@
    pointer allocate(size_type count, cvoid_ptr hint = 0)
    {
       (void)hint;
- if(count > ((size_type)-1)/sizeof(T))
+ if(count > this->max_size())
          throw bad_alloc();
       return pointer((value_type*)mp_mngr->allocate(count*sizeof(T)));
    }
@@ -166,7 +161,13 @@
    friend void swap(self_t &alloc1, self_t &alloc2)
    { detail::do_swap(alloc1.mp_mngr, alloc2.mp_mngr); }
 
- //Experimental version 2 allocator functions
+ //!Returns maximum the number of objects the previously allocated memory
+ //!pointed by p can hold. This size only works for memory allocated with
+ //!allocate, allocation_command and allocate_many.
+ size_type size(const pointer &p) const
+ {
+ return (size_type)mp_mngr->size(detail::get_pointer(p))/sizeof(T);
+ }
 
    std::pair<pointer, bool>
       allocation_command(allocation_type command,
@@ -178,23 +179,42 @@
          (command, limit_size, preferred_size, received_size, detail::get_pointer(reuse));
    }
 
- //!Returns maximum the number of objects the previously allocated memory
- //!pointed by p can hold.
- size_type size(const pointer &p) const
- {
- return (size_type)mp_mngr->size(detail::get_pointer(p))/sizeof(T);
+ //!Allocates many elements of size elem_size in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. The elements must be deallocated
+ //!with deallocate(...)
+ multiallocation_iterator allocate_many(size_type elem_size, std::size_t num_elements)
+ {
+ return multiallocation_iterator
+ (mp_mngr->allocate_many(sizeof(T)*elem_size, num_elements));
    }
 
+ //!Allocates n_elements elements, each one of size elem_sizes[i]in a
+ //!contiguous chunk
+ //!of memory. The elements must be deallocated
+ multiallocation_iterator allocate_many(const size_type *elem_sizes, size_type n_elements)
+ {
+ return multiallocation_iterator
+ (mp_mngr->allocate_many(elem_sizes, n_elements, sizeof(T)));
+ }
+
+ //!Allocates many elements of size elem_size in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. The elements must be deallocated
+ //!with deallocate(...)
+ void deallocate_many(multiallocation_iterator it)
+ { return mp_mngr->deallocate_many(it.base()); }
+
    //!Allocates just one object. Memory allocated with this function
    //!must be deallocated only with deallocate_one().
    //!Throws boost::interprocess::bad_alloc if there is no enough memory
    pointer allocate_one()
    { return this->allocate(1); }
 
- /// @cond
-
- //Experimental. Don't use.
-
    //!Allocates many elements of size == 1 in a contiguous chunk
    //!of memory. The minimum number to be allocated is min_elements,
    //!the preferred and maximum number is
@@ -204,41 +224,20 @@
    multiallocation_iterator allocate_individual(std::size_t num_elements)
    { return this->allocate_many(1, num_elements); }
 
- /// @endcond
-
    //!Deallocates memory previously allocated with allocate_one().
    //!You should never use deallocate_one to deallocate memory allocated
    //!with other functions different from allocate_one(). Never throws
    void deallocate_one(const pointer &p)
    { return this->deallocate(p, 1); }
 
- /// @cond
-
- //!Allocates many elements of size elem_size in a contiguous chunk
+ //!Allocates many elements of size == 1 in a contiguous chunk
    //!of memory. The minimum number to be allocated is min_elements,
    //!the preferred and maximum number is
    //!preferred_elements. The number of actually allocated elements is
- //!will be assigned to received_size. The elements must be deallocated
- //!with deallocate(...)
- multiallocation_iterator allocate_many(size_type elem_size, std::size_t num_elements)
- {
- return multiallocation_iterator
- (mp_mngr->allocate_many(sizeof(T)*elem_size, num_elements));
- }
-
- //!Allocates n_elements elements, each one of size elem_sizes[i]in a
- //!contiguous chunk
- //!of memory. The elements must be deallocated
- multiallocation_iterator allocate_many(const size_type *elem_sizes, size_type n_elements)
- {
- return multiallocation_iterator
- (mp_mngr->allocate_many(elem_sizes, n_elements, sizeof(T)));
- }
-
- /// @endcond
-
- //These functions are obsolete. These are here to conserve
- //backwards compatibility with containers using them...
+ //!will be assigned to received_size. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ void deallocate_individual(multiallocation_iterator it)
+ { return this->deallocate_many(it); }
 
    //!Returns address of mutable object.
    //!Never throws
@@ -251,7 +250,7 @@
    { return const_pointer(boost::addressof(value)); }
 
    //!Default construct an object.
- //!Throws if T's default constructor throws*/
+ //!Throws if T's default constructor throws
    void construct(const pointer &ptr)
    { new(detail::get_pointer(ptr)) value_type; }
 

Modified: branches/fix-links/boost/interprocess/allocators/cached_adaptive_pool.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/allocators/cached_adaptive_pool.hpp (original)
+++ branches/fix-links/boost/interprocess/allocators/cached_adaptive_pool.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -19,56 +19,155 @@
 #include <boost/interprocess/detail/workaround.hpp>
 
 #include <boost/interprocess/interprocess_fwd.hpp>
-#include <boost/interprocess/detail/utilities.hpp>
-#include <boost/assert.hpp>
-#include <boost/utility/addressof.hpp>
 #include <boost/interprocess/allocators/detail/adaptive_node_pool.hpp>
+#include <boost/interprocess/allocators/detail/allocator_common.hpp>
 #include <boost/interprocess/detail/workaround.hpp>
-#include <boost/interprocess/exceptions.hpp>
+#include <boost/interprocess/detail/version_type.hpp>
 #include <boost/interprocess/allocators/detail/node_tools.hpp>
-#include <memory>
-#include <algorithm>
 #include <cstddef>
 
 //!\file
-//!Describes cached_cached_node_allocator pooled shared memory STL compatible allocator
+//!Describes cached_adaptive_pool pooled shared memory STL compatible allocator
 
 namespace boost {
 namespace interprocess {
 
+/// @cond
+
+namespace detail {
+
+template < class T
+ , class SegmentManager
+ , std::size_t NodesPerChunk = 64
+ , std::size_t MaxFreeChunks = 2
+ , unsigned char OverheadPercent = 5
+ >
+class cached_adaptive_pool_v1
+ : public detail::cached_allocator_impl
+ < T
+ , detail::shared_adaptive_node_pool
+ < SegmentManager
+ , sizeof(T)
+ , NodesPerChunk
+ , MaxFreeChunks
+ , OverheadPercent
+ >
+ , 1>
+{
+ public:
+ typedef detail::cached_allocator_impl
+ < T
+ , detail::shared_adaptive_node_pool
+ < SegmentManager
+ , sizeof(T)
+ , NodesPerChunk
+ , MaxFreeChunks
+ , OverheadPercent
+ >
+ , 1> base_t;
+
+ template<class T2>
+ struct rebind
+ {
+ typedef cached_adaptive_pool_v1
+ <T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ };
+
+ cached_adaptive_pool_v1(SegmentManager *segment_mngr,
+ std::size_t max_cached_nodes = base_t::DEFAULT_MAX_CACHED_NODES)
+ : base_t(segment_mngr, max_cached_nodes)
+ {}
+
+ template<class T2>
+ cached_adaptive_pool_v1
+ (const cached_adaptive_pool_v1
+ <T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other)
+ : base_t(other)
+ {}
+};
+
+} //namespace detail{
+
+/// @endcond
+
 //!An STL node allocator that uses a segment manager as memory
 //!source. The internal pointer type will of the same type (raw, smart) as
 //!"typename SegmentManager::void_pointer" type. This allows
 //!placing the allocator in shared memory, memory mapped-files, etc...
+//!
 //!This node allocator shares a segregated storage between all instances of
-//!cached_adaptive_pool with equal sizeof(T) placed in the same fixed size
+//!cached_adaptive_pool with equal sizeof(T) placed in the same
 //!memory segment. But also caches some nodes privately to
 //!avoid some synchronization overhead.
-template<class T, class SegmentManager, std::size_t NodesPerChunk, std::size_t MaxFreeChunks>
+//!
+//!NodesPerChunk is the minimum number of nodes of nodes allocated at once when
+//!the allocator needs runs out of nodes. MaxFreeChunks is the maximum number of totally free chunks
+//!that the adaptive node pool will hold. The rest of the totally free chunks will be
+//!deallocated with the segment manager.
+//!
+//!OverheadPercent is the (approximated) maximum size overhead (1-20%) of the allocator:
+//!(memory usable for nodes / total memory allocated from the segment manager)
+template < class T
+ , class SegmentManager
+ , std::size_t NodesPerChunk
+ , std::size_t MaxFreeChunks
+ , unsigned char OverheadPercent
+ >
 class cached_adaptive_pool
-{
    /// @cond
- typedef typename SegmentManager::void_pointer void_pointer;
- typedef typename detail::
- pointer_to_other<void_pointer, const void>::type cvoid_pointer;
- typedef SegmentManager segment_manager;
- typedef typename detail::
- pointer_to_other<void_pointer, char>::type char_pointer;
- typedef typename SegmentManager::mutex_family::mutex_type mutex_type;
- typedef cached_adaptive_pool
- <T, SegmentManager, NodesPerChunk, MaxFreeChunks> self_t;
- enum { DEFAULT_MAX_CACHED_NODES = 64 };
-
- typedef typename detail::node_slist<void_pointer>::node_t node_t;
- typedef typename detail::node_slist<void_pointer>::node_slist_t cached_list_t;
+ : public detail::cached_allocator_impl
+ < T
+ , detail::shared_adaptive_node_pool
+ < SegmentManager
+ , sizeof(T)
+ , NodesPerChunk
+ , MaxFreeChunks
+ , OverheadPercent
+ >
+ , 2>
    /// @endcond
+{
+
+ #ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
+ public:
+ typedef detail::cached_allocator_impl
+ < T
+ , detail::shared_adaptive_node_pool
+ < SegmentManager
+ , sizeof(T)
+ , NodesPerChunk
+ , MaxFreeChunks
+ , OverheadPercent
+ >
+ , 2> base_t;
 
    public:
- //-------
- typedef typename detail::
- pointer_to_other<void_pointer, T>::type pointer;
- typedef typename detail::
- pointer_to_other<void_pointer, const T>::type const_pointer;
+ typedef detail::version_type<cached_adaptive_pool, 2> version;
+
+ template<class T2>
+ struct rebind
+ {
+ typedef cached_adaptive_pool
+ <T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ };
+
+ cached_adaptive_pool(SegmentManager *segment_mngr,
+ std::size_t max_cached_nodes = base_t::DEFAULT_MAX_CACHED_NODES)
+ : base_t(segment_mngr, max_cached_nodes)
+ {}
+
+ template<class T2>
+ cached_adaptive_pool
+ (const cached_adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other)
+ : base_t(other)
+ {}
+
+ #else
+ public:
+ typedef implementation_defined::segment_manager segment_manager;
+ typedef segment_manager::void_pointer void_pointer;
+ typedef implementation_defined::pointer pointer;
+ typedef implementation_defined::const_pointer const_pointer;
    typedef T value_type;
    typedef typename detail::add_reference
                      <value_type>::type reference;
@@ -76,312 +175,178 @@
                      <const value_type>::type const_reference;
    typedef std::size_t size_type;
    typedef std::ptrdiff_t difference_type;
- typedef detail::shared_adaptive_node_pool
- < SegmentManager, mutex_type
- , sizeof(T), NodesPerChunk, MaxFreeChunks> node_pool_t;
- typedef typename detail::
- pointer_to_other<void_pointer, node_pool_t>::type node_pool_ptr;
 
- //!Obtains cached_adaptive_pool from other
+ //!Obtains cached_adaptive_pool from
    //!cached_adaptive_pool
    template<class T2>
    struct rebind
    {
- typedef cached_adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks> other;
+ typedef cached_adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
    };
 
- /// @cond
    private:
-
- //!Not assignable from related cached_adaptive_pool
- template<class T2, class SegmentManager2, std::size_t N2, std::size_t MaxFreeChunks2>
+ //!Not assignable from
+ //!related cached_adaptive_pool
+ template<class T2, class SegmentManager2, std::size_t N2, std::size_t F2, unsigned char OP2>
    cached_adaptive_pool& operator=
- (const cached_adaptive_pool<T2, SegmentManager2, N2, MaxFreeChunks2>&);
+ (const cached_adaptive_pool<T2, SegmentManager2, N2, F2, OP2>&);
 
- //!Not assignable from other cached_adaptive_pool
+ //!Not assignable from
+ //!other cached_adaptive_pool
    cached_adaptive_pool& operator=(const cached_adaptive_pool&);
- /// @endcond
-
+
    public:
- //!Constructor from a segment manager. If not present, constructs
- //!a node pool. Increments the reference count of the node pool.
+ //!Constructor from a segment manager. If not present, constructs a node
+ //!pool. Increments the reference count of the associated node pool.
    //!Can throw boost::interprocess::bad_alloc
- cached_adaptive_pool(segment_manager *segment_mngr,
- std::size_t max_cached_nodes = DEFAULT_MAX_CACHED_NODES)
- : mp_node_pool(priv_get_or_create(segment_mngr)),
- m_max_cached_nodes(max_cached_nodes)
- {}
+ cached_adaptive_pool(segment_manager *segment_mngr);
 
- //!Copy constructor from other cached_adaptive_pool. Increments the
- //!reference count of the associated node pool. Never throws
- cached_adaptive_pool(const cached_adaptive_pool &other)
- : mp_node_pool(other.get_node_pool()),
- m_max_cached_nodes(other.get_max_cached_nodes())
- { mp_node_pool->inc_ref_count(); }
+ //!Copy constructor from other cached_adaptive_pool. Increments the reference
+ //!count of the associated node pool. Never throws
+ cached_adaptive_pool(const cached_adaptive_pool &other);
 
    //!Copy constructor from related cached_adaptive_pool. If not present, constructs
    //!a node pool. Increments the reference count of the associated node pool.
    //!Can throw boost::interprocess::bad_alloc
    template<class T2>
    cached_adaptive_pool
- (const cached_adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks> &other)
- : mp_node_pool(priv_get_or_create(other.get_segment_manager())),
- m_max_cached_nodes(other.get_max_cached_nodes())
- { }
+ (const cached_adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other);
 
    //!Destructor, removes node_pool_t from memory
    //!if its reference count reaches to zero. Never throws
- ~cached_adaptive_pool()
- {
- priv_deallocate_all_cached_nodes();
- priv_destroy_if_last_link();
- }
+ ~cached_adaptive_pool();
 
    //!Returns a pointer to the node pool.
    //!Never throws
- node_pool_t* get_node_pool() const
- { return detail::get_pointer(mp_node_pool); }
+ node_pool_t* get_node_pool() const;
 
    //!Returns the segment manager.
    //!Never throws
- segment_manager* get_segment_manager()const
- { return mp_node_pool->get_segment_manager(); }
-
- //!Sets the new max cached nodes value. This can provoke deallocations
- //!if "newmax" is less than current cached nodes. Never throws
- void set_max_cached_nodes(std::size_t newmax)
- {
- m_max_cached_nodes = newmax;
- priv_deallocate_remaining_nodes();
- }
+ segment_manager* get_segment_manager()const;
 
- //!Returns the max cached nodes parameter.
+ //!Returns the number of elements that could be allocated.
    //!Never throws
- std::size_t get_max_cached_nodes() const
- { return m_max_cached_nodes; }
-
- //!Returns the number of elements that could be
- //!allocated. Never throws
- size_type max_size() const
- { return this->get_segment_manager()->get_size()/sizeof(value_type); }
+ size_type max_size() const;
 
    //!Allocate memory for an array of count elements.
    //!Throws boost::interprocess::bad_alloc if there is no enough memory
- pointer allocate(size_type count, cvoid_pointer hint = 0)
- {
- (void)hint;
- if(count > ((size_type)-1)/sizeof(value_type))
- throw bad_alloc();
- typedef detail::shared_adaptive_node_pool
- <SegmentManager, mutex_type, sizeof(T), NodesPerChunk, MaxFreeChunks> node_pool_t;
-
- void * ret;
-
- if(count == 1){
- //If don't have any cached node, we have to get a new list of free nodes from the pool
- if(m_cached_nodes.empty()){
- mp_node_pool->allocate_nodes(m_max_cached_nodes/2, m_cached_nodes);
- }
- ret = &m_cached_nodes.front();
- m_cached_nodes.pop_front();
- }
- else{
- ret = mp_node_pool->allocate(count);
- }
- return pointer(static_cast<T*>(ret));
- }
-
- //!Deallocate allocated memory. Never throws
- void deallocate(const pointer &ptr, size_type count)
- {
- typedef detail::shared_adaptive_node_pool
- <SegmentManager, mutex_type, sizeof(T), NodesPerChunk, MaxFreeChunks> node_pool_t;
-
- if(count == 1){
- //Check if cache is full
- if(m_cached_nodes.size() >= m_max_cached_nodes){
- //This only occurs if this allocator deallocate memory allocated
- //with other equal allocator. Since the cache is full, and more
- //deallocations are probably coming, we'll make some room in cache
- //in a single, efficient multi node deallocation.
- priv_deallocate_n_nodes(m_cached_nodes.size() - m_max_cached_nodes/2);
- }
- m_cached_nodes.push_front(*(node_t*)detail::char_ptr_cast(detail::get_pointer(ptr)));
- }
- else{
- mp_node_pool->deallocate(detail::get_pointer(ptr), count);
- }
- }
-
- //!Deallocates all free chunks of the pool
- void deallocate_free_chunks()
- { mp_node_pool->deallocate_free_chunks(); }
+ pointer allocate(size_type count, cvoid_pointer hint = 0);
 
- //!Swaps allocators. Does not throw. If each allocator is placed in a
- //!different shared memory segments, the result is undefined.
- friend void swap(self_t &alloc1, self_t &alloc2)
- {
- detail::do_swap(alloc1.mp_node_pool, alloc2.mp_node_pool);
- alloc1.m_cached_nodes.swap(alloc2.m_cached_nodes);
- detail::do_swap(alloc1.m_max_cached_nodes, alloc2.m_max_cached_nodes);
- }
+ //!Deallocate allocated memory.
+ //!Never throws
+ void deallocate(const pointer &ptr, size_type count);
 
- void deallocate_cache()
- { this->priv_deallocate_all_cached_nodes(); }
+ //!Deallocates all free chunks
+ //!of the pool
+ void deallocate_free_chunks();
 
- //These functions are obsolete. These are here to conserve
- //backwards compatibility with containers using them...
+ //!Swaps allocators. Does not throw. If each allocator is placed in a
+ //!different memory segment, the result is undefined.
+ friend void swap(self_t &alloc1, self_t &alloc2);
 
    //!Returns address of mutable object.
    //!Never throws
- pointer address(reference value) const
- { return pointer(boost::addressof(value)); }
+ pointer address(reference value) const;
 
    //!Returns address of non mutable object.
    //!Never throws
- const_pointer address(const_reference value) const
- { return const_pointer(boost::addressof(value)); }
+ const_pointer address(const_reference value) const;
 
    //!Default construct an object.
- //!Throws if T's default constructor throws*/
- void construct(const pointer &ptr)
- { new(detail::get_pointer(ptr)) value_type; }
+ //!Throws if T's default constructor throws
+ void construct(const pointer &ptr);
 
    //!Destroys object. Throws if object's
    //!destructor throws
- void destroy(const pointer &ptr)
- { BOOST_ASSERT(ptr != 0); (*ptr).~value_type(); }
-
- /// @cond
- private:
+ void destroy(const pointer &ptr);
 
- //!Object function that creates the node allocator if it is not created and
- //!increments reference count if it is already created
- struct get_or_create_func
- {
- typedef detail::shared_adaptive_node_pool
- <SegmentManager, mutex_type, sizeof(T), NodesPerChunk, MaxFreeChunks> node_pool_t;
-
- //!This connects or constructs the unique instance of node_pool_t
- //!Can throw boost::interprocess::bad_alloc
- void operator()()
- {
- //Find or create the node_pool_t
- mp_node_pool = mp_named_alloc->template find_or_construct
- <node_pool_t>(unique_instance)(mp_named_alloc);
- //If valid, increment link count
- if(mp_node_pool != 0)
- mp_node_pool->inc_ref_count();
- }
-
- //!Constructor. Initializes function
- //!object parameters
- get_or_create_func(segment_manager *hdr) : mp_named_alloc(hdr){}
-
- node_pool_t *mp_node_pool;
- segment_manager *mp_named_alloc;
- };
+ //!Returns maximum the number of objects the previously allocated memory
+ //!pointed by p can hold. This size only works for memory allocated with
+ //!allocate, allocation_command and allocate_many.
+ size_type size(const pointer &p) const;
+
+ std::pair<pointer, bool>
+ allocation_command(allocation_type command,
+ size_type limit_size,
+ size_type preferred_size,
+ size_type &received_size, const pointer &reuse = 0);
+
+ //!Allocates many elements of size elem_size in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. The elements must be deallocated
+ //!with deallocate(...)
+ multiallocation_iterator allocate_many(size_type elem_size, std::size_t num_elements);
+
+ //!Allocates n_elements elements, each one of size elem_sizes[i]in a
+ //!contiguous chunk
+ //!of memory. The elements must be deallocated
+ multiallocation_iterator allocate_many(const size_type *elem_sizes, size_type n_elements);
+
+ //!Allocates many elements of size elem_size in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. The elements must be deallocated
+ //!with deallocate(...)
+ void deallocate_many(multiallocation_iterator it);
 
- //!Frees all cached nodes.
- //!Never throws
- void priv_deallocate_all_cached_nodes()
- {
- if(m_cached_nodes.empty()) return;
- mp_node_pool->deallocate_nodes(m_cached_nodes);
- }
+ //!Allocates just one object. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ //!Throws boost::interprocess::bad_alloc if there is no enough memory
+ pointer allocate_one();
 
- //!Frees all cached nodes at once.
- //!Never throws
- void priv_deallocate_remaining_nodes()
- {
- if(m_cached_nodes.size() > m_max_cached_nodes){
- priv_deallocate_n_nodes(m_cached_nodes.size()-m_max_cached_nodes);
- }
- }
-
- //!Frees n cached nodes at once. Never throws
- void priv_deallocate_n_nodes(std::size_t n)
- {
- //Deallocate all new linked list at once
- mp_node_pool->deallocate_nodes(m_cached_nodes, n);
- }
-
- //!Initialization function, creates an executes atomically the
- //!initialization object functions. Can throw boost::interprocess::bad_alloc
- node_pool_t *priv_get_or_create(segment_manager *named_alloc)
- {
- get_or_create_func func(named_alloc);
- named_alloc->atomic_func(func);
- return func.mp_node_pool;
- }
+ //!Allocates many elements of size == 1 in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ multiallocation_iterator allocate_individual(std::size_t num_elements);
+
+ //!Deallocates memory previously allocated with allocate_one().
+ //!You should never use deallocate_one to deallocate memory allocated
+ //!with other functions different from allocate_one(). Never throws
+ void deallocate_one(const pointer &p);
+
+ //!Allocates many elements of size == 1 in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ void deallocate_individual(multiallocation_iterator it);
+ //!Sets the new max cached nodes value. This can provoke deallocations
+ //!if "newmax" is less than current cached nodes. Never throws
+ void set_max_cached_nodes(std::size_t newmax);
 
- //!Object function that decrements the reference count. If the count
- //!reaches to zero destroys the node allocator from memory.
+ //!Returns the max cached nodes parameter.
    //!Never throws
- struct destroy_if_last_link_func
- {
- typedef detail::shared_adaptive_node_pool
- <SegmentManager, mutex_type,sizeof(T), NodesPerChunk, MaxFreeChunks> node_pool_t;
-
- //!Decrements reference count and destroys the object if there is no
- //!more attached allocators. Never throws
- void operator()()
- {
- //If not the last link return
- if(mp_node_pool->dec_ref_count() != 0) return;
-
- //Last link, let's destroy the segment_manager
- mp_named_alloc->template destroy<node_pool_t>(unique_instance);
- }
-
- //!Constructor. Initializes function
- //!object parameters
- destroy_if_last_link_func(segment_manager *nhdr,
- node_pool_t *phdr)
- : mp_named_alloc(nhdr), mp_node_pool(phdr){}
-
- segment_manager *mp_named_alloc;
- node_pool_t *mp_node_pool;
- };
+ std::size_t get_max_cached_nodes() const;
+ #endif
+};
 
- //!Destruction function, initializes and executes destruction function
- //!object. Never throws
- void priv_destroy_if_last_link()
- {
- typedef detail::shared_adaptive_node_pool
- <SegmentManager, mutex_type,sizeof(T), NodesPerChunk, MaxFreeChunks> node_pool_t;
- //Get segment manager
- segment_manager *segment_mngr = this->get_segment_manager();
- //Execute destruction functor atomically
- destroy_if_last_link_func func(segment_mngr, detail::get_pointer(mp_node_pool));
- segment_mngr->atomic_func(func);
- }
+#ifdef BOOST_INTERPROCESS_DOXYGEN_INVOKED
 
- private:
- node_pool_ptr mp_node_pool;
- cached_list_t m_cached_nodes;
- std::size_t m_max_cached_nodes;
- /// @endcond
-};
+//!Equality test for same type
+//!of cached_adaptive_pool
+template<class T, class S, std::size_t NodesPerChunk, std::size_t F, std::size_t OP> inline
+bool operator==(const cached_adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc1,
+ const cached_adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc2);
+
+//!Inequality test for same type
+//!of cached_adaptive_pool
+template<class T, class S, std::size_t NodesPerChunk, std::size_t F, std::size_t OP> inline
+bool operator!=(const cached_adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc1,
+ const cached_adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc2);
 
-//!Equality test for same type of
-//!cached_adaptive_pool
-template<class T, class S, std::size_t NodesPerChunk, std::size_t M> inline
-bool operator==(const cached_adaptive_pool<T, S, NodesPerChunk, M> &alloc1,
- const cached_adaptive_pool<T, S, NodesPerChunk, M> &alloc2)
- { return alloc1.get_node_pool() == alloc2.get_node_pool(); }
-
-//!Inequality test for same type of
-//!cached_adaptive_pool
-template<class T, class S, std::size_t NodesPerChunk, std::size_t M> inline
-bool operator!=(const cached_adaptive_pool<T, S, NodesPerChunk, M> &alloc1,
- const cached_adaptive_pool<T, S, NodesPerChunk, M> &alloc2)
- { return alloc1.get_node_pool() != alloc2.get_node_pool(); }
+#endif
 
 } //namespace interprocess {
-
 } //namespace boost {
 
+
 #include <boost/interprocess/detail/config_end.hpp>
 
 #endif //#ifndef BOOST_INTERPROCESS_CACHED_ADAPTIVE_POOL_HPP

Modified: branches/fix-links/boost/interprocess/allocators/cached_node_allocator.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/allocators/cached_node_allocator.hpp (original)
+++ branches/fix-links/boost/interprocess/allocators/cached_node_allocator.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -19,14 +19,11 @@
 #include <boost/interprocess/detail/workaround.hpp>
 
 #include <boost/interprocess/interprocess_fwd.hpp>
-#include <boost/interprocess/detail/utilities.hpp>
-#include <boost/assert.hpp>
-#include <boost/utility/addressof.hpp>
 #include <boost/interprocess/allocators/detail/node_pool.hpp>
+#include <boost/interprocess/allocators/detail/allocator_common.hpp>
 #include <boost/interprocess/detail/workaround.hpp>
-#include <boost/interprocess/exceptions.hpp>
-#include <memory>
-#include <algorithm>
+#include <boost/interprocess/detail/version_type.hpp>
+#include <boost/interprocess/allocators/detail/node_tools.hpp>
 #include <cstddef>
 
 //!\file
@@ -35,37 +32,113 @@
 namespace boost {
 namespace interprocess {
 
-//!An STL node allocator that uses a segment manager as memory
-//!source. The internal pointer type will of the same type (raw, smart) as
-//!"typename SegmentManager::void_pointer" type. This allows
-//!placing the allocator in shared memory, memory mapped-files, etc...
-//!This node allocator shares a segregated storage between all instances of
-//!cached_node_allocator with equal sizeof(T) placed in the same fixed size
-//!memory segment. But also caches some nodes privately to
-//!avoid some synchronization overhead.
-template<class T, class SegmentManager, std::size_t NodesPerChunk>
-class cached_node_allocator
+
+/// @cond
+
+namespace detail {
+
+template < class T
+ , class SegmentManager
+ , std::size_t NodesPerChunk = 64
+ >
+class cached_node_allocator_v1
+ : public detail::cached_allocator_impl
+ < T
+ , detail::shared_node_pool
+ < SegmentManager
+ , sizeof(T)
+ , NodesPerChunk
+ >
+ , 1>
 {
+ public:
+ typedef detail::cached_allocator_impl
+ < T
+ , detail::shared_node_pool
+ < SegmentManager
+ , sizeof(T)
+ , NodesPerChunk
+ >
+ , 1> base_t;
+
+ template<class T2>
+ struct rebind
+ {
+ typedef cached_node_allocator_v1
+ <T2, SegmentManager, NodesPerChunk> other;
+ };
+
+ cached_node_allocator_v1(SegmentManager *segment_mngr,
+ std::size_t max_cached_nodes = base_t::DEFAULT_MAX_CACHED_NODES)
+ : base_t(segment_mngr, max_cached_nodes)
+ {}
+
+ template<class T2>
+ cached_node_allocator_v1
+ (const cached_node_allocator_v1
+ <T2, SegmentManager, NodesPerChunk> &other)
+ : base_t(other)
+ {}
+};
+
+} //namespace detail{
+
+/// @endcond
+
+template < class T
+ , class SegmentManager
+ , std::size_t NodesPerChunk
+ >
+class cached_node_allocator
    /// @cond
- typedef typename SegmentManager::void_pointer void_pointer;
- typedef typename detail::
- pointer_to_other<void_pointer, const void>::type cvoid_pointer;
- typedef SegmentManager segment_manager;
- typedef typename detail::
- pointer_to_other<void_pointer, char>::type char_pointer;
- typedef typename SegmentManager::mutex_family::mutex_type mutex_type;
- typedef cached_node_allocator<T, SegmentManager, NodesPerChunk> self_t;
- enum { DEFAULT_MAX_CACHED_NODES = 64 };
- typedef typename detail::node_slist<void_pointer>::node_t node_t;
- typedef typename detail::node_slist<void_pointer>::node_slist_t cached_list_t;
+ : public detail::cached_allocator_impl
+ < T
+ , detail::shared_node_pool
+ < SegmentManager
+ , sizeof(T)
+ , NodesPerChunk
+ >
+ , 2>
    /// @endcond
+{
+
+ #ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
+ public:
+ typedef detail::cached_allocator_impl
+ < T
+ , detail::shared_node_pool
+ < SegmentManager
+ , sizeof(T)
+ , NodesPerChunk
+ >
+ , 2> base_t;
 
    public:
- //-------
- typedef typename detail::
- pointer_to_other<void_pointer, T>::type pointer;
- typedef typename detail::
- pointer_to_other<void_pointer, const T>::type const_pointer;
+ typedef detail::version_type<cached_node_allocator, 2> version;
+
+ template<class T2>
+ struct rebind
+ {
+ typedef cached_node_allocator<T2, SegmentManager, NodesPerChunk> other;
+ };
+
+ cached_node_allocator(SegmentManager *segment_mngr,
+ std::size_t max_cached_nodes = base_t::DEFAULT_MAX_CACHED_NODES)
+ : base_t(segment_mngr, max_cached_nodes)
+ {}
+
+ template<class T2>
+ cached_node_allocator
+ (const cached_node_allocator<T2, SegmentManager, NodesPerChunk> &other)
+ : base_t(other)
+ {}
+
+ #else
+ public:
+ typedef implementation_defined::segment_manager segment_manager;
+ typedef segment_manager::void_pointer void_pointer;
+ typedef implementation_defined::pointer pointer;
+ typedef implementation_defined::const_pointer const_pointer;
    typedef T value_type;
    typedef typename detail::add_reference
                      <value_type>::type reference;
@@ -73,302 +146,173 @@
                      <const value_type>::type const_reference;
    typedef std::size_t size_type;
    typedef std::ptrdiff_t difference_type;
- typedef detail::shared_node_pool
- < SegmentManager, mutex_type
- , sizeof(T), NodesPerChunk> node_pool_t;
- typedef typename detail::
- pointer_to_other<void_pointer, node_pool_t>::type node_pool_ptr;
 
- //!Obtains cached_node_allocator from other cached_node_allocator
+ //!Obtains cached_node_allocator from
+ //!cached_node_allocator
    template<class T2>
    struct rebind
    {
- typedef cached_node_allocator<T2, SegmentManager, NodesPerChunk> other;
+ typedef cached_node_allocator<T2, SegmentManager> other;
    };
 
- /// @cond
    private:
-
- //!Not assignable from related cached_node_allocator
+ //!Not assignable from
+ //!related cached_node_allocator
    template<class T2, class SegmentManager2, std::size_t N2>
    cached_node_allocator& operator=
       (const cached_node_allocator<T2, SegmentManager2, N2>&);
 
- //!Not assignable from other cached_node_allocator
+ //!Not assignable from
+ //!other cached_node_allocator
    cached_node_allocator& operator=(const cached_node_allocator&);
- /// @endcond
 
    public:
- //!Constructor from a segment manager. If not present, constructs
- //!a node pool. Increments the reference count of the node pool.
+ //!Constructor from a segment manager. If not present, constructs a node
+ //!pool. Increments the reference count of the associated node pool.
    //!Can throw boost::interprocess::bad_alloc
- cached_node_allocator(segment_manager *segment_mngr,
- std::size_t max_cached_nodes = DEFAULT_MAX_CACHED_NODES)
- : mp_node_pool(priv_get_or_create(segment_mngr)),
- m_max_cached_nodes(max_cached_nodes)
- {}
+ cached_node_allocator(segment_manager *segment_mngr);
 
- //!Copy constructor from other cached_node_allocator. Increments the
- //!reference count of the associated node pool. Never throws
- cached_node_allocator(const cached_node_allocator &other)
- : mp_node_pool(other.get_node_pool()),
- m_max_cached_nodes(other.get_max_cached_nodes())
- { mp_node_pool->inc_ref_count(); }
+ //!Copy constructor from other cached_node_allocator. Increments the reference
+ //!count of the associated node pool. Never throws
+ cached_node_allocator(const cached_node_allocator &other);
 
    //!Copy constructor from related cached_node_allocator. If not present, constructs
    //!a node pool. Increments the reference count of the associated node pool.
    //!Can throw boost::interprocess::bad_alloc
    template<class T2>
    cached_node_allocator
- (const cached_node_allocator<T2, SegmentManager, NodesPerChunk> &other)
- : mp_node_pool(priv_get_or_create(other.get_segment_manager())),
- m_max_cached_nodes(other.get_max_cached_nodes())
- { }
+ (const cached_node_allocator<T2, SegmentManager, NodesPerChunk> &other);
 
    //!Destructor, removes node_pool_t from memory
    //!if its reference count reaches to zero. Never throws
- ~cached_node_allocator()
- {
- priv_deallocate_all_cached_nodes();
- priv_destroy_if_last_link();
- }
+ ~cached_node_allocator();
 
    //!Returns a pointer to the node pool.
    //!Never throws
- node_pool_t* get_node_pool() const
- { return detail::get_pointer(mp_node_pool); }
+ node_pool_t* get_node_pool() const;
 
    //!Returns the segment manager.
    //!Never throws
- segment_manager* get_segment_manager()const
- { return mp_node_pool->get_segment_manager(); }
-
- //!Sets the new max cached nodes value. This can provoke deallocations
- //!if "newmax" is less than current cached nodes. Never throws
- void set_max_cached_nodes(std::size_t newmax)
- {
- m_max_cached_nodes = newmax;
- priv_deallocate_remaining_nodes();
- }
+ segment_manager* get_segment_manager()const;
 
- //!Returns the max cached nodes parameter.
+ //!Returns the number of elements that could be allocated.
    //!Never throws
- std::size_t get_max_cached_nodes() const
- { return m_max_cached_nodes; }
-
- //!Returns the number of elements that could be allocated. Never throws
- size_type max_size() const
- { return this->get_segment_manager()->get_size()/sizeof(value_type); }
+ size_type max_size() const;
 
    //!Allocate memory for an array of count elements.
    //!Throws boost::interprocess::bad_alloc if there is no enough memory
- pointer allocate(size_type count, cvoid_pointer hint = 0)
- {
- (void)hint;
- if(count > ((size_type)-1)/sizeof(value_type))
- throw bad_alloc();
- typedef detail::shared_node_pool
- <SegmentManager, mutex_type, sizeof(T), NodesPerChunk> node_pool_t;
-
- void * ret;
-
- if(count == 1){
- //If don't have any cached node, we have to get a new list of free nodes from the pool
- if(m_cached_nodes.empty()){
- mp_node_pool->allocate_nodes(m_max_cached_nodes/2, m_cached_nodes);
- }
- ret = &m_cached_nodes.front();
- m_cached_nodes.pop_front();
- }
- else{
- ret = mp_node_pool->allocate(count);
- }
- return pointer(static_cast<T*>(ret));
- }
+ pointer allocate(size_type count, cvoid_pointer hint = 0);
 
    //!Deallocate allocated memory.
    //!Never throws
- void deallocate(const pointer &ptr, size_type count)
- {
- typedef detail::shared_node_pool
- <SegmentManager, mutex_type, sizeof(T), NodesPerChunk> node_pool_t;
-
- if(count == 1){
- //Check if cache is full
- if(m_cached_nodes.size() >= m_max_cached_nodes){
- //This only occurs if this allocator deallocate memory allocated
- //with other equal allocator. Since the cache is full, and more
- //deallocations are probably coming, we'll make some room in cache
- //in a single, efficient multi node deallocation.
- priv_deallocate_n_nodes(m_cached_nodes.size() - m_max_cached_nodes/2);
- }
- m_cached_nodes.push_front(*(node_t*)detail::char_ptr_cast(detail::get_pointer(ptr)));
- }
- else{
- mp_node_pool->deallocate(detail::get_pointer(ptr), count);
- }
- }
+ void deallocate(const pointer &ptr, size_type count);
 
- //!Swaps allocators. Does not throw. If each allocator is placed in a
- //!different shared memory segments, the result is undefined.
- friend void swap(self_t &alloc1, self_t &alloc2)
- {
- detail::do_swap(alloc1.mp_node_pool, alloc2.mp_node_pool);
- alloc1.m_cached_nodes.swap(alloc2.m_cached_nodes);
- detail::do_swap(alloc1.m_max_cached_nodes, alloc2.m_max_cached_nodes);
- }
-
- //!Returns the cached nodes to the shared pool
- void deallocate_cache()
- { this->priv_deallocate_all_cached_nodes(); }
-
- //!Deallocates all free chunks of the pool
- void deallocate_free_chunks()
- { mp_node_pool->deallocate_free_chunks(); }
+ //!Deallocates all free chunks
+ //!of the pool
+ void deallocate_free_chunks();
 
- //These functions are obsolete. These are here to conserve
- //backwards compatibility with containers using them...
+ //!Swaps allocators. Does not throw. If each allocator is placed in a
+ //!different memory segment, the result is undefined.
+ friend void swap(self_t &alloc1, self_t &alloc2);
 
    //!Returns address of mutable object.
    //!Never throws
- pointer address(reference value) const
- { return pointer(boost::addressof(value)); }
+ pointer address(reference value) const;
 
    //!Returns address of non mutable object.
    //!Never throws
- const_pointer address(const_reference value) const
- { return const_pointer(boost::addressof(value)); }
+ const_pointer address(const_reference value) const;
 
    //!Default construct an object.
- //!Throws if T's default constructor throws*/
- void construct(const pointer &ptr)
- { new(detail::get_pointer(ptr)) value_type; }
+ //!Throws if T's default constructor throws
+ void construct(const pointer &ptr);
 
    //!Destroys object. Throws if object's
    //!destructor throws
- void destroy(const pointer &ptr)
- { BOOST_ASSERT(ptr != 0); (*ptr).~value_type(); }
+ void destroy(const pointer &ptr);
 
- /// @cond
- private:
-
- //!Object function that creates the node allocator if it is not created and
- //!increments reference count if it is already created
- struct get_or_create_func
- {
- typedef detail::shared_node_pool
- <SegmentManager, mutex_type, sizeof(T), NodesPerChunk> node_pool_t;
-
- //!This connects or constructs the unique instance of node_pool_t
- //!Can throw boost::interprocess::bad_alloc
- void operator()()
- {
- //Find or create the node_pool_t
- mp_node_pool = mp_named_alloc->template find_or_construct
- <node_pool_t>(unique_instance)(mp_named_alloc);
- //If valid, increment link count
- if(mp_node_pool != 0)
- mp_node_pool->inc_ref_count();
- }
-
- //!Constructor. Initializes function
- //!object parameters
- get_or_create_func(segment_manager *hdr) : mp_named_alloc(hdr){}
-
- node_pool_t *mp_node_pool;
- segment_manager *mp_named_alloc;
- };
+ //!Returns maximum the number of objects the previously allocated memory
+ //!pointed by p can hold. This size only works for memory allocated with
+ //!allocate, allocation_command and allocate_many.
+ size_type size(const pointer &p) const;
+
+ std::pair<pointer, bool>
+ allocation_command(allocation_type command,
+ size_type limit_size,
+ size_type preferred_size,
+ size_type &received_size, const pointer &reuse = 0);
+
+ //!Allocates many elements of size elem_size in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. The elements must be deallocated
+ //!with deallocate(...)
+ multiallocation_iterator allocate_many(size_type elem_size, std::size_t num_elements);
+
+ //!Allocates n_elements elements, each one of size elem_sizes[i]in a
+ //!contiguous chunk
+ //!of memory. The elements must be deallocated
+ multiallocation_iterator allocate_many(const size_type *elem_sizes, size_type n_elements);
+
+ //!Allocates many elements of size elem_size in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. The elements must be deallocated
+ //!with deallocate(...)
+ void deallocate_many(multiallocation_iterator it);
 
- //!Frees all cached nodes.
- //!Never throws
- void priv_deallocate_all_cached_nodes()
- { mp_node_pool->deallocate_nodes(m_cached_nodes); }
-
- //!Frees all cached nodes at once.
- //!Never throws
- void priv_deallocate_remaining_nodes()
- {
- if(m_cached_nodes.size() > m_max_cached_nodes){
- priv_deallocate_n_nodes(m_cached_nodes.size()-m_max_cached_nodes);
- }
- }
-
- //!Frees n cached nodes at once.
- //!Never throws
- void priv_deallocate_n_nodes(std::size_t n)
- { mp_node_pool->deallocate_nodes(m_cached_nodes, n); }
+ //!Allocates just one object. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ //!Throws boost::interprocess::bad_alloc if there is no enough memory
+ pointer allocate_one();
 
- //!Initialization function, creates an executes atomically the
- //!initialization object functions. Can throw boost::interprocess::bad_alloc
- node_pool_t *priv_get_or_create(segment_manager *named_alloc)
- {
- get_or_create_func func(named_alloc);
- named_alloc->atomic_func(func);
- return func.mp_node_pool;
- }
+ //!Allocates many elements of size == 1 in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ multiallocation_iterator allocate_individual(std::size_t num_elements);
+
+ //!Deallocates memory previously allocated with allocate_one().
+ //!You should never use deallocate_one to deallocate memory allocated
+ //!with other functions different from allocate_one(). Never throws
+ void deallocate_one(const pointer &p);
+
+ //!Allocates many elements of size == 1 in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ void deallocate_individual(multiallocation_iterator it);
+ //!Sets the new max cached nodes value. This can provoke deallocations
+ //!if "newmax" is less than current cached nodes. Never throws
+ void set_max_cached_nodes(std::size_t newmax);
 
- //!Object function that decrements the reference count. If the count
- //!reaches to zero destroys the node allocator from memory.
+ //!Returns the max cached nodes parameter.
    //!Never throws
- struct destroy_if_last_link_func
- {
- typedef detail::shared_node_pool
- <SegmentManager, mutex_type,sizeof(T), NodesPerChunk> node_pool_t;
-
- //!Decrements reference count and destroys the object if there is no
- //!more attached allocators. Never throws
- void operator()()
- {
- //If not the last link return
- if(mp_node_pool->dec_ref_count() != 0) return;
-
- //Last link, let's destroy the segment_manager
- mp_named_alloc->template destroy<node_pool_t>(unique_instance);
- }
-
- //!Constructor. Initializes function object
- //!parameters
- destroy_if_last_link_func(segment_manager *nhdr,
- node_pool_t *phdr)
- : mp_named_alloc(nhdr), mp_node_pool(phdr){}
-
- segment_manager *mp_named_alloc;
- node_pool_t *mp_node_pool;
- };
-
- //!Destruction function, initializes and executes destruction function
- //!object. Never throws
- void priv_destroy_if_last_link()
- {
- typedef detail::shared_node_pool
- <SegmentManager, mutex_type,sizeof(T), NodesPerChunk> node_pool_t;
- //Get segment manager
- segment_manager *segment_mngr = this->get_segment_manager();
- //Execute destruction functor atomically
- destroy_if_last_link_func func(segment_mngr, detail::get_pointer(mp_node_pool));
- segment_mngr->atomic_func(func);
- }
-
- private:
- node_pool_ptr mp_node_pool;
- cached_list_t m_cached_nodes;
- std::size_t m_max_cached_nodes;
- /// @endcond
+ std::size_t get_max_cached_nodes() const;
+ #endif
 };
 
-//!Equality test for same type of
-//!cached_node_allocator
+#ifdef BOOST_INTERPROCESS_DOXYGEN_INVOKED
+
+//!Equality test for same type
+//!of cached_node_allocator
 template<class T, class S, std::size_t NodesPerChunk> inline
 bool operator==(const cached_node_allocator<T, S, NodesPerChunk> &alloc1,
- const cached_node_allocator<T, S, NodesPerChunk> &alloc2)
- { return alloc1.get_node_pool() == alloc2.get_node_pool(); }
+ const cached_node_allocator<T, S, NodesPerChunk> &alloc2);
 
-//!Inequality test for same type of
-//!cached_node_allocator
+//!Inequality test for same type
+//!of cached_node_allocator
 template<class T, class S, std::size_t NodesPerChunk> inline
 bool operator!=(const cached_node_allocator<T, S, NodesPerChunk> &alloc1,
- const cached_node_allocator<T, S, NodesPerChunk> &alloc2)
- { return alloc1.get_node_pool() != alloc2.get_node_pool(); }
+ const cached_node_allocator<T, S, NodesPerChunk> &alloc2);
+
+#endif
 
 } //namespace interprocess {
 } //namespace boost {

Modified: branches/fix-links/boost/interprocess/allocators/detail/adaptive_node_pool.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/allocators/detail/adaptive_node_pool.hpp (original)
+++ branches/fix-links/boost/interprocess/allocators/detail/adaptive_node_pool.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -17,20 +17,21 @@
 
 #include <boost/interprocess/detail/config_begin.hpp>
 #include <boost/interprocess/detail/workaround.hpp>
+#include <boost/interprocess/interprocess_fwd.hpp>
 #include <boost/interprocess/sync/interprocess_mutex.hpp>
 #include <boost/interprocess/detail/utilities.hpp>
 #include <boost/interprocess/detail/min_max.hpp>
 #include <boost/interprocess/detail/math_functions.hpp>
 #include <boost/interprocess/exceptions.hpp>
-#include <boost/intrusive/list.hpp>
+#include <boost/intrusive/set.hpp>
 #include <boost/intrusive/slist.hpp>
 #include <boost/math/common_factor_ct.hpp>
 #include <boost/interprocess/detail/type_traits.hpp>
 #include <boost/interprocess/allocators/detail/node_tools.hpp>
+#include <boost/interprocess/allocators/detail/allocator_common.hpp>
 #include <cstddef>
 #include <cmath>
 #include <cassert>
-#include <cassert>
 
 //!\file
 //!Describes the real adaptive pool shared by many Interprocess pool allocators
@@ -39,10 +40,6 @@
 namespace interprocess {
 namespace detail {
 
-//!Pooled shared memory allocator using an smart adaptive pool. Includes
-//!a reference count but the class does not delete itself, this is
-//!responsibility of user classes. Node size (NodeSize) and the number of
-//!nodes allocated per chunk (NodesPerChunk) are known at compile time.
 template<class SegmentManagerBase>
 class private_adaptive_node_pool_impl
 {
@@ -56,19 +53,85 @@
    public:
    typedef typename node_slist<void_pointer>::node_t node_t;
    typedef typename node_slist<void_pointer>::node_slist_t free_nodes_t;
+ typedef typename SegmentManagerBase::multiallocation_iterator multiallocation_iterator;
+ typedef typename SegmentManagerBase::multiallocation_chain multiallocation_chain;
 
    private:
- //This hook will be used to chain the memory chunks
- typedef typename bi::make_list_base_hook
- <bi::void_pointer<void_pointer>, bi::link_mode<bi::normal_link> >::type list_hook_t;
+ typedef typename bi::make_set_base_hook
+ < bi::void_pointer<void_pointer>
+ , bi::optimize_size<true>
+ , bi::constant_time_size<false>
+ , bi::link_mode<bi::normal_link> >::type multiset_hook_t;
+
+ struct hdr_offset_holder
+ {
+ hdr_offset_holder(std::size_t offset = 0)
+ : hdr_offset(offset)
+ {}
+ std::size_t hdr_offset;
+ };
 
    struct chunk_info_t
- : public list_hook_t
+ :
+ public hdr_offset_holder,
+ public multiset_hook_t
    {
       //An intrusive list of free node from this chunk
       free_nodes_t free_nodes;
+ friend bool operator <(const chunk_info_t &l, const chunk_info_t &r)
+ {
+// { return l.free_nodes.size() < r.free_nodes.size(); }
+ //Let's order blocks first by free nodes and then by address
+ //so that highest address fully free chunks are deallocated.
+ //This improves returning memory to the OS (trimming).
+ const bool is_less = l.free_nodes.size() < r.free_nodes.size();
+ const bool is_equal = l.free_nodes.size() == r.free_nodes.size();
+ return is_less || (is_equal && (&l < &r));
+ }
    };
- typedef typename bi::make_list<chunk_info_t, bi::base_hook<list_hook_t> >::type chunk_list_t;
+ typedef typename bi::make_multiset
+ <chunk_info_t, bi::base_hook<multiset_hook_t> >::type chunk_multiset_t;
+ typedef typename chunk_multiset_t::iterator chunk_iterator;
+
+ static const std::size_t MaxAlign = alignment_of<node_t>::value;
+ static const std::size_t HdrSize = ((sizeof(chunk_info_t)-1)/MaxAlign+1)*MaxAlign;
+ static const std::size_t HdrOffsetSize = ((sizeof(hdr_offset_holder)-1)/MaxAlign+1)*MaxAlign;
+ static std::size_t calculate_alignment
+ (std::size_t overhead_percent, std::size_t real_node_size)
+ {
+ //to-do: handle real_node_size != node_size
+ const std::size_t divisor = overhead_percent*real_node_size;
+ const std::size_t dividend = HdrOffsetSize*100;
+ std::size_t elements_per_subchunk = (dividend - 1)/divisor + 1;
+ std::size_t candidate_power_of_2 =
+ upper_power_of_2(elements_per_subchunk*real_node_size + HdrOffsetSize);
+ bool overhead_satisfied = false;
+ while(!overhead_satisfied){
+ elements_per_subchunk = (candidate_power_of_2 - HdrOffsetSize)/real_node_size;
+ std::size_t overhead_size = candidate_power_of_2 - elements_per_subchunk*real_node_size;
+ if(overhead_size*100/candidate_power_of_2 < overhead_percent){
+ overhead_satisfied = true;
+ }
+ else{
+ candidate_power_of_2 <<= 1;
+ }
+ }
+ return candidate_power_of_2;
+ }
+
+ static void calculate_num_subchunks
+ (std::size_t alignment, std::size_t real_node_size, std::size_t elements_per_chunk
+ ,std::size_t &num_subchunks, std::size_t &real_num_node)
+ {
+ std::size_t elements_per_subchunk = (alignment - HdrOffsetSize)/real_node_size;
+ std::size_t possible_num_subchunk = (elements_per_chunk - 1)/elements_per_subchunk + 1;
+ std::size_t hdr_subchunk_elements = (alignment - HdrSize - SegmentManagerBase::PayloadPerAllocation)/real_node_size;
+ while(((possible_num_subchunk-1)*elements_per_subchunk + hdr_subchunk_elements) < elements_per_chunk){
+ ++possible_num_subchunk;
+ }
+ num_subchunks = possible_num_subchunk;
+ real_num_node = (possible_num_subchunk-1)*elements_per_subchunk + hdr_subchunk_elements;
+ }
 
    public:
    //!Segment manager typedef
@@ -77,26 +140,25 @@
    //!Constructor from a segment manager. Never throws
    private_adaptive_node_pool_impl
       ( segment_manager_base_type *segment_mngr_base, std::size_t node_size
- , std::size_t nodes_per_chunk, std::size_t max_free_chunks)
- : m_node_size(node_size)
- , m_max_free_chunks(max_free_chunks)
- , m_real_node_size(lcm(m_node_size, sizeof(node_t)))
- , m_header_size(min_value(get_rounded_size(sizeof(chunk_info_t), alignment_of<max_align>::value)
- ,get_rounded_size(sizeof(chunk_info_t), m_real_node_size)))
- //Round the size to a power of two value.
- //This is the total memory size (including payload) that we want to
- //allocate from the general-purpose allocator
- , m_real_chunk_alignment(upper_power_of_2(m_header_size + m_real_node_size*nodes_per_chunk))
+ , std::size_t nodes_per_chunk, std::size_t max_free_chunks
+ , unsigned char overhead_percent
+ )
+ : m_max_free_chunks(max_free_chunks)
+ , m_real_node_size(lcm(node_size, std::size_t(alignment_of<node_t>::value)))
+ //Round the size to a power of two value.
+ //This is the total memory size (including payload) that we want to
+ //allocate from the general-purpose allocator
+ , m_real_chunk_alignment(calculate_alignment(overhead_percent, m_real_node_size))
       //This is the real number of nodes per chunk
- , m_real_num_node((m_real_chunk_alignment - SegmentManagerBase::PayloadPerAllocation - m_header_size)/m_real_node_size)
+ , m_num_subchunks(0)
+ , m_real_num_node(0)
       //General purpose allocator
    , mp_segment_mngr_base(segment_mngr_base)
- , m_chunklist()
- , m_first_free_chunk(m_chunklist.end())
- //Debug node count
- , m_allocated(0)
- , m_free_chunks(0)
- {}
+ , m_chunk_multiset()
+ , m_totally_free_chunks(0)
+ {
+ calculate_num_subchunks(m_real_chunk_alignment, m_real_node_size, nodes_per_chunk, m_num_subchunks, m_real_num_node);
+ }
 
    //!Destructor. Deallocates all allocated chunks. Never throws
    ~private_adaptive_node_pool_impl()
@@ -110,60 +172,118 @@
    { return detail::get_pointer(mp_segment_mngr_base); }
 
    //!Allocates array of count elements. Can throw boost::interprocess::bad_alloc
- void *allocate(std::size_t count)
+ void *allocate_node()
    {
- std::size_t bytes = count*m_node_size;
- if(bytes > m_real_node_size){//Normal allocation, no pooling used
- void *addr = mp_segment_mngr_base->allocate(bytes);
- if(!addr) throw bad_alloc();
- return addr;
+ priv_invariants();
+ //If there are no free nodes we allocate a new block
+ if (m_chunk_multiset.empty()){
+ priv_alloc_chunk(1);
       }
- else //Node allocation, pooling used
- return priv_alloc_node();
+ //We take the first free node the multiset can't be empty
+ return priv_take_first_node();
    }
-
+
    //!Deallocates an array pointed by ptr. Never throws
- void deallocate(void *ptr, std::size_t count)
+ void deallocate_node(void *pElem)
    {
- std::size_t bytes = count*m_node_size;
- if(bytes > m_real_node_size)//Normal allocation was used
- mp_segment_mngr_base->deallocate(ptr);
- else //Node allocation was used
- priv_dealloc_node(ptr);
+ priv_invariants();
+ chunk_info_t *chunk_info = priv_chunk_from_node(pElem);
+ assert(chunk_info->free_nodes.size() < m_real_num_node);
+ //We put the node at the beginning of the free node list
+ node_t * to_deallocate = static_cast<node_t*>(pElem);
+ chunk_info->free_nodes.push_front(*to_deallocate);
+
+ chunk_iterator this_chunk(chunk_multiset_t::s_iterator_to(*chunk_info));
+ chunk_iterator next_chunk(this_chunk);
+ ++next_chunk;
+
+ //Cache the free nodes from the chunk
+ std::size_t this_chunk_free_nodes = this_chunk->free_nodes.size();
+
+ if(this_chunk_free_nodes == 1){
+ m_chunk_multiset.insert(m_chunk_multiset.begin(), *chunk_info);
+ }
+ else{
+ chunk_iterator next_chunk(this_chunk);
+ ++next_chunk;
+ if(next_chunk != m_chunk_multiset.end()){
+ std::size_t next_free_nodes = next_chunk->free_nodes.size();
+ if(this_chunk_free_nodes > next_free_nodes){
+ //Now move the chunk to the new position
+ m_chunk_multiset.erase(this_chunk);
+ m_chunk_multiset.insert(*chunk_info);
+ }
+ }
+ }
+ //Update free chunk count
+ if(this_chunk_free_nodes == m_real_num_node){
+ ++m_totally_free_chunks;
+ priv_deallocate_free_chunks(m_max_free_chunks);
+ }
+ priv_invariants();
    }
 
    //!Allocates a singly linked list of n nodes ending in null pointer.
    //!can throw boost::interprocess::bad_alloc
- void allocate_nodes(const std::size_t n, free_nodes_t &nodes)
+ void allocate_nodes(multiallocation_chain &nodes, const std::size_t n)
    {
- std::size_t i = 0;
+ std::size_t old_node_count = nodes.size();
       try{
- for(; i < n; ++i){
- nodes.push_front(*priv_alloc_node());
+ priv_invariants();
+ for(std::size_t i = 0; i != n; ++i){
+ //If there are no free nodes we allocate all needed chunks
+ if (m_chunk_multiset.empty()){
+ priv_alloc_chunk(((n - i) - 1)/m_real_num_node + 1);
+ }
+ nodes.push_front(priv_take_first_node());
          }
       }
       catch(...){
- priv_deallocate_nodes(nodes, i);
+ priv_deallocate_nodes(nodes, nodes.size());
+ priv_deallocate_free_chunks(m_max_free_chunks);
          throw;
       }
+ //remove me
+ assert((n+old_node_count) == (std::size_t)std::distance(nodes.get_it(), multiallocation_iterator()));
+ priv_invariants();
+ }
+
+ //!Allocates n nodes, pointed by the multiallocation_iterator.
+ //!Can throw boost::interprocess::bad_alloc
+ multiallocation_iterator allocate_nodes(const std::size_t n)
+ {
+ multiallocation_chain chain;
+ this->allocate_nodes(chain, n);
+ return chain.get_it();
    }
 
    //!Deallocates a linked list of nodes. Never throws
- void deallocate_nodes(free_nodes_t &nodes)
+ void deallocate_nodes(multiallocation_chain &nodes)
    { priv_deallocate_nodes(nodes, nodes.size()); }
 
    //!Deallocates the first n nodes of a linked list of nodes. Never throws
- void deallocate_nodes(free_nodes_t &nodes, std::size_t n)
+ void deallocate_nodes(multiallocation_chain &nodes, std::size_t n)
    { priv_deallocate_nodes(nodes, n); }
 
+ //!Deallocates the nodes pointed by the multiallocation iterator. Never throws
+ void deallocate_nodes(multiallocation_iterator it)
+ {
+ multiallocation_iterator itend;
+ while(it != itend){
+ void *addr = &*it;
+ ++it;
+ deallocate_node(addr);
+ }
+ }
+
    void deallocate_free_chunks()
    { priv_deallocate_free_chunks(0); }
 
    std::size_t num_free_nodes()
    {
- typedef typename chunk_list_t::const_iterator citerator;
+ typedef typename chunk_multiset_t::const_iterator citerator;
       std::size_t count = 0;
- citerator it (m_first_free_chunk), itend(m_chunklist.end());
+ citerator it (m_chunk_multiset.begin()), itend(m_chunk_multiset.end());
       for(; it != itend; ++it){
          count += it->free_nodes.size();
       }
@@ -172,22 +292,40 @@
 
    void swap(private_adaptive_node_pool_impl &other)
    {
+ assert(m_max_free_chunks == other.m_max_free_chunks);
+ assert(m_real_node_size == other.m_real_node_size);
+ assert(m_real_chunk_alignment == other.m_real_chunk_alignment);
+ assert(m_real_num_node == other.m_real_num_node);
       std::swap(mp_segment_mngr_base, other.mp_segment_mngr_base);
- m_chunklist.swap(other.m_chunklist);
- std::swap(m_first_free_chunk, other.m_first_free_chunk);
- std::swap(m_allocated, other.m_allocated);
- std::swap(m_free_chunks, other.m_allocated);
+ std::swap(m_totally_free_chunks, other.m_totally_free_chunks);
+ m_chunk_multiset.swap(other.m_chunk_multiset);
    }
 
    private:
+ node_t *priv_take_first_node()
+ {
+ assert(m_chunk_multiset.begin() != m_chunk_multiset.end());
+ //We take the first free node the multiset can't be empty
+ free_nodes_t &free_nodes = m_chunk_multiset.begin()->free_nodes;
+ node_t *first_node = &free_nodes.front();
+ const std::size_t free_nodes_count = free_nodes.size();
+ assert(0 != free_nodes_count);
+ free_nodes.pop_front();
+ if(free_nodes_count == 1){
+ m_chunk_multiset.erase(m_chunk_multiset.begin());
+ }
+ else if(free_nodes_count == m_real_num_node){
+ --m_totally_free_chunks;
+ }
+ priv_invariants();
+ return first_node;
+ }
 
- void priv_deallocate_nodes(free_nodes_t &nodes, const std::size_t num)
+ void priv_deallocate_nodes(multiallocation_chain &nodes, const std::size_t num)
    {
       assert(nodes.size() >= num);
       for(std::size_t i = 0; i < num; ++i){
- node_t *to_deallocate = &nodes.front();
- nodes.pop_front();
- deallocate(to_deallocate, 1);
+ deallocate_node(nodes.pop_front());
       }
    }
 
@@ -197,71 +335,75 @@
    class chunk_destroyer
    {
       public:
- chunk_destroyer(segment_manager_base_type *mngr, std::size_t real_num_node)
- : mngr_(mngr), m_real_num_node(real_num_node)
+ chunk_destroyer(const private_adaptive_node_pool_impl *impl)
+ : mp_impl(impl)
       {}
 
- void operator()(typename chunk_list_t::pointer to_deallocate)
+ void operator()(typename chunk_multiset_t::pointer to_deallocate)
       {
          std::size_t free_nodes = to_deallocate->free_nodes.size();
          (void)free_nodes;
- assert(free_nodes == m_real_num_node);
- mngr_->deallocate(detail::get_pointer(to_deallocate));
+ assert(free_nodes == mp_impl->m_real_num_node);
+ assert(0 == to_deallocate->hdr_offset);
+ hdr_offset_holder *hdr_off_holder = mp_impl->priv_first_subchunk_from_chunk((chunk_info_t*)detail::get_pointer(to_deallocate));
+ mp_impl->mp_segment_mngr_base->deallocate(hdr_off_holder);
       }
- segment_manager_base_type *mngr_;
- const std::size_t m_real_num_node;
+ const private_adaptive_node_pool_impl *mp_impl;
    };
 
    //This macro will activate invariant checking. Slow, but helpful for debugging the code.
- //#define BOOST_INTERPROCESS_ADAPTIVE_NODE_POOL_CHECK_INVARIANTS
+ #define BOOST_INTERPROCESS_ADAPTIVE_NODE_POOL_CHECK_INVARIANTS
    void priv_invariants()
    #ifdef BOOST_INTERPROCESS_ADAPTIVE_NODE_POOL_CHECK_INVARIANTS
    #undef BOOST_INTERPROCESS_ADAPTIVE_NODE_POOL_CHECK_INVARIANTS
    {
- typedef typename chunk_list_t::iterator chunk_iterator;
- //We iterate though the chunk list to free the memory
- chunk_iterator it(m_chunklist.begin()),
- itend(m_chunklist.end()), to_deallocate;
- for(++it; it != itend; ++it){
- chunk_iterator prev(it);
- --prev;
- std::size_t sp = prev->free_nodes.size(),
- si = it->free_nodes.size();
- assert(sp <= si);
- (void)sp; (void)si;
- }
-
- //Check that the total free nodes are correct
- it = m_chunklist.begin();
- itend = m_chunklist.end();
- std::size_t total_free = 0;
- for(; it != itend; ++it){
- total_free += it->free_nodes.size();
+ //We iterate through the chunk list to free the memory
+ chunk_iterator it(m_chunk_multiset.begin()),
+ itend(m_chunk_multiset.end()), to_deallocate;
+ if(it != itend){
+ for(++it; it != itend; ++it){
+ chunk_iterator prev(it);
+ --prev;
+ std::size_t sp = prev->free_nodes.size(),
+ si = it->free_nodes.size();
+ assert(sp <= si);
+ (void)sp; (void)si;
+ }
       }
- assert(total_free >= m_free_chunks*m_real_num_node);
 
- //Check that the total totally free chunks are correct
- it = m_chunklist.begin();
- itend = m_chunklist.end();
- total_free = 0;
- for(; it != itend; ++it){
- total_free += it->free_nodes.size() == m_real_num_node;
- }
- assert(total_free >= m_free_chunks);
-
- //The chunk pointed by m_first_free_chunk should point
- //to end or to a non-empty chunk
- if(m_first_free_chunk != m_chunklist.end()){
- std::size_t s = m_first_free_chunk->free_nodes.size();
- assert(s != 0);
+ {
+ //Check that the total free nodes are correct
+ it = m_chunk_multiset.begin();
+ itend = m_chunk_multiset.end();
+ std::size_t total_free_nodes = 0;
+ for(; it != itend; ++it){
+ total_free_nodes += it->free_nodes.size();
+ }
+ assert(total_free_nodes >= m_totally_free_chunks*m_real_num_node);
       }
 
- //All previous nodes of m_first_free_chunk should be 0
- it = m_chunklist.begin();
- itend = m_first_free_chunk;
+ {
+ //Check that the total totally free chunks are correct
+ it = m_chunk_multiset.begin();
+ itend = m_chunk_multiset.end();
+ std::size_t total_free_chunks = 0;
+ for(; it != itend; ++it){
+ total_free_chunks += (it->free_nodes.size() == m_real_num_node);
+ }
+ assert(total_free_chunks == m_totally_free_chunks);
+ }
+ {
+ //Check that header offsets are correct
+ it = m_chunk_multiset.begin();
       for(; it != itend; ++it){
- std::size_t s = it->free_nodes.size();
- assert(s == 0);
+ hdr_offset_holder *hdr_off_holder = priv_first_subchunk_from_chunk(&*it);
+ for(std::size_t i = 0, max = m_num_subchunks; i < max; ++i){
+ assert(hdr_off_holder->hdr_offset == std::size_t((char*)&*it- (char*)hdr_off_holder));
+ assert(0 == ((std::size_t)hdr_off_holder & (m_real_chunk_alignment - 1)));
+ assert(0 == (hdr_off_holder->hdr_offset & (m_real_chunk_alignment - 1)));
+ hdr_off_holder = (hdr_offset_holder *)((char*)hdr_off_holder + m_real_chunk_alignment);
+ }
+ }
       }
    }
    #else
@@ -271,165 +413,136 @@
    //!Deallocates all used memory. Never throws
    void priv_clear()
    {
- //Check for memory leaks
- assert(m_allocated==0);
- priv_invariants();
- m_first_free_chunk = m_chunklist.end();
- m_chunklist.clear_and_dispose
- (chunk_destroyer(detail::get_pointer(mp_segment_mngr_base), m_real_num_node));
- m_free_chunks = 0;
- }
-
- chunk_info_t *priv_chunk_from_node(void *node)
- {
- return (chunk_info_t *)((std::size_t)node & std::size_t(~(m_real_chunk_alignment - 1)));
- }
-
- //!Allocates one node, using the adaptive pool algorithm.
- //!Never throws
- node_t *priv_alloc_node()
- {
- priv_invariants();
- //If there are no free nodes we allocate a new block
- if (m_first_free_chunk == m_chunklist.end()){
- priv_alloc_chunk();
- --m_first_free_chunk;
- }
- //We take the first free node since m_first_free_chunk can't be end()
- chunk_info_t &chunk_info = *m_first_free_chunk;
- assert(!chunk_info.free_nodes.empty());
- node_t *first_node = &chunk_info.free_nodes.front();
- if(chunk_info.free_nodes.size() == 1){
- ++m_first_free_chunk;
- }
- else if(chunk_info.free_nodes.size() == m_real_num_node){
- --m_free_chunks;
- }
- chunk_info.free_nodes.pop_front();
- ++m_allocated;
- priv_invariants();
- return detail::get_pointer(first_node);
- }
-
- //!Deallocates one node, using the adaptive pool algorithm.
- //!Never throws
- void priv_dealloc_node(void *pElem)
- {
- typedef typename chunk_list_t::iterator chunk_iterator;
- priv_invariants();
- chunk_info_t *chunk_info = priv_chunk_from_node(pElem);
- assert(chunk_info->free_nodes.size() < m_real_num_node);
- //We put the node at the beginning of the free node list
- node_t * to_deallocate = static_cast<node_t*>(pElem);
- chunk_info->free_nodes.push_front(*to_deallocate);
- chunk_iterator this_chunk(chunk_list_t::s_iterator_to(*chunk_info));
- chunk_iterator next_chunk(this_chunk);
- ++next_chunk;
-
- //If this chunk has more free nodes than the next ones,
- //we have to move the chunk in the list to maintain it ordered.
- //Check if we have to move it
- while(next_chunk != m_chunklist.end() &&
- this_chunk->free_nodes.size() > next_chunk->free_nodes.size()){
- ++next_chunk;
- }
- //Check if the chunk must be moved
- if(++chunk_iterator(this_chunk) != next_chunk){
- //Update m_first_free_chunk iterator if it was pointing to this_chunk
- if(m_first_free_chunk == this_chunk){
- ++m_first_free_chunk;
- }
- //Update m_first_free_chunk if the moved chunk crosses the empty boundary
- else if(this_chunk->free_nodes.size() == 1){
- m_first_free_chunk = chunk_list_t::s_iterator_to(*chunk_info);
- }
- //Now move the chunk to the new position
- m_chunklist.erase(this_chunk);
- m_chunklist.insert(next_chunk, *chunk_info);
- }
- //Update m_first_free_chunk if the chunk crosses the empty boundary
- else if(this_chunk->free_nodes.size() == 1){
- --m_first_free_chunk;
- }
-
- if(this_chunk->free_nodes.size() == m_real_num_node){
- ++m_free_chunks;
+ #ifndef NDEBUG
+ chunk_iterator it = m_chunk_multiset.begin();
+ chunk_iterator itend = m_chunk_multiset.end();
+ std::size_t num_free_nodes = 0;
+ for(; it != itend; ++it){
+ //Check for memory leak
+ assert(it->free_nodes.size() == m_real_num_node);
+ ++num_free_nodes;
       }
-
- assert(m_allocated>0);
- --m_allocated;
- priv_invariants();
- priv_deallocate_free_chunks(m_max_free_chunks);
+ assert(num_free_nodes == m_totally_free_chunks);
+ #endif
       priv_invariants();
+ m_chunk_multiset.clear_and_dispose
+ (chunk_destroyer(this));
+ m_totally_free_chunks = 0;
+ }
+
+ chunk_info_t *priv_chunk_from_node(void *node) const
+ {
+ hdr_offset_holder *hdr_off_holder =
+ (hdr_offset_holder*)((std::size_t)node & std::size_t(~(m_real_chunk_alignment - 1)));
+ assert(0 == ((std::size_t)hdr_off_holder & (m_real_chunk_alignment - 1)));
+ assert(0 == (hdr_off_holder->hdr_offset & (m_real_chunk_alignment - 1)));
+ chunk_info_t *chunk = (chunk_info_t *)(((char*)hdr_off_holder) + hdr_off_holder->hdr_offset);
+ assert(chunk->hdr_offset == 0);
+ return chunk;
+ }
+
+ hdr_offset_holder *priv_first_subchunk_from_chunk(chunk_info_t *chunk) const
+ {
+ hdr_offset_holder *hdr_off_holder = (hdr_offset_holder*)
+ (((char*)chunk) - (m_num_subchunks-1)*m_real_chunk_alignment);
+ assert(hdr_off_holder->hdr_offset == std::size_t((char*)chunk - (char*)hdr_off_holder));
+ assert(0 == ((std::size_t)hdr_off_holder & (m_real_chunk_alignment - 1)));
+ assert(0 == (hdr_off_holder->hdr_offset & (m_real_chunk_alignment - 1)));
+ return hdr_off_holder;
    }
 
    void priv_deallocate_free_chunks(std::size_t max_free_chunks)
    {
- typedef typename chunk_list_t::iterator chunk_iterator;
+ priv_invariants();
       //Now check if we've reached the free nodes limit
       //and check if we have free chunks. If so, deallocate as much
       //as we can to stay below the limit
- while(m_free_chunks > max_free_chunks &&
- m_chunklist.back().free_nodes.size() == m_real_num_node){
- chunk_iterator it(--m_chunklist.end());
- if(it == m_first_free_chunk)
- ++m_first_free_chunk; //m_first_free_chunk is now equal to end()
- m_chunklist.erase_and_dispose(it, chunk_destroyer(detail::get_pointer(mp_segment_mngr_base),m_real_num_node));
- --m_free_chunks;
+ for( chunk_iterator itend = m_chunk_multiset.end()
+ ; m_totally_free_chunks > max_free_chunks
+ ; --m_totally_free_chunks
+ ){
+ assert(!m_chunk_multiset.empty());
+ chunk_iterator it = itend;
+ --it;
+ std::size_t num_nodes = it->free_nodes.size();
+ assert(num_nodes == m_real_num_node);
+ (void)num_nodes;
+ m_chunk_multiset.erase_and_dispose
+ (it, chunk_destroyer(this));
       }
    }
 
- //!Allocates a chunk of nodes. Can throw boost::interprocess::bad_alloc
- void priv_alloc_chunk()
- {
- //We allocate a new NodeBlock and put it as first
- //element in the free Node list
- std::size_t real_chunk_size = m_real_chunk_alignment - SegmentManagerBase::PayloadPerAllocation;
- char *pNode = detail::char_ptr_cast
- (mp_segment_mngr_base->allocate_aligned(real_chunk_size, m_real_chunk_alignment));
- if(!pNode) throw bad_alloc();
- chunk_info_t *c_info = new(pNode)chunk_info_t;
- m_chunklist.push_back(*c_info);
-
- pNode += m_header_size;
- //We initialize all Nodes in Node Block to insert
- //them in the free Node list
- for(std::size_t i = 0; i < m_real_num_node; ++i){
- c_info->free_nodes.push_front(*new (pNode) node_t);
- pNode += m_real_node_size;
+ //!Allocates a several chunks of nodes. Can throw boost::interprocess::bad_alloc
+ void priv_alloc_chunk(std::size_t n)
+ {
+ std::size_t real_chunk_size = m_real_chunk_alignment*m_num_subchunks - SegmentManagerBase::PayloadPerAllocation;
+ std::size_t elements_per_subchunk = (m_real_chunk_alignment - HdrOffsetSize)/m_real_node_size;
+ std::size_t hdr_subchunk_elements = (m_real_chunk_alignment - HdrSize - SegmentManagerBase::PayloadPerAllocation)/m_real_node_size;
+
+ for(std::size_t i = 0; i != n; ++i){
+ //We allocate a new NodeBlock and put it the last
+ //element of the tree
+ char *mem_address = detail::char_ptr_cast
+ (mp_segment_mngr_base->allocate_aligned(real_chunk_size, m_real_chunk_alignment));
+ if(!mem_address) throw std::bad_alloc();
+ ++m_totally_free_chunks;
+
+ //First initialize header information on the last subchunk
+ char *hdr_addr = mem_address + m_real_chunk_alignment*(m_num_subchunks-1);
+ chunk_info_t *c_info = new(hdr_addr)chunk_info_t;
+ //Some structural checks
+ assert(static_cast<void*>(&static_cast<hdr_offset_holder*>(c_info)->hdr_offset) ==
+ static_cast<void*>(c_info));
+ typename free_nodes_t::iterator prev_insert_pos = c_info->free_nodes.before_begin();
+ for( std::size_t subchunk = 0, maxsubchunk = m_num_subchunks - 1
+ ; subchunk < maxsubchunk
+ ; ++subchunk, mem_address += m_real_chunk_alignment){
+ //Initialize header offset mark
+ new(mem_address) hdr_offset_holder(std::size_t(hdr_addr - mem_address));
+ char *pNode = mem_address + HdrOffsetSize;
+ for(std::size_t i = 0; i < elements_per_subchunk; ++i){
+ prev_insert_pos = c_info->free_nodes.insert_after(prev_insert_pos, *new (pNode) node_t);
+ pNode += m_real_node_size;
+ }
+ }
+ {
+ char *pNode = hdr_addr + HdrSize;
+ //We initialize all Nodes in Node Block to insert
+ //them in the free Node list
+ for(std::size_t i = 0; i < hdr_subchunk_elements; ++i){
+ prev_insert_pos = c_info->free_nodes.insert_after(prev_insert_pos, *new (pNode) node_t);
+ pNode += m_real_node_size;
+ }
+ }
+ //Insert the chunk after the free node list is full
+ m_chunk_multiset.insert(m_chunk_multiset.end(), *c_info);
       }
- ++m_free_chunks;
    }
 
    private:
    typedef typename pointer_to_other
       <void_pointer, segment_manager_base_type>::type segment_mngr_base_ptr_t;
 
- const std::size_t m_node_size;
    const std::size_t m_max_free_chunks;
    const std::size_t m_real_node_size;
- const std::size_t m_header_size;
    //Round the size to a power of two value.
    //This is the total memory size (including payload) that we want to
    //allocate from the general-purpose allocator
    const std::size_t m_real_chunk_alignment;
+ std::size_t m_num_subchunks;
    //This is the real number of nodes per chunk
- const std::size_t m_real_num_node;
+ //const
+ std::size_t m_real_num_node;
    segment_mngr_base_ptr_t mp_segment_mngr_base;//Segment manager
- chunk_list_t m_chunklist; //Intrusive chunk list
- typename chunk_list_t::iterator m_first_free_chunk; //Iterator to the active chunk
- std::size_t m_allocated; //Used nodes for debugging
- std::size_t m_free_chunks; //Free chunks
+ chunk_multiset_t m_chunk_multiset; //Intrusive chunk list
+ std::size_t m_totally_free_chunks; //Free chunks
 };
 
-//!Pooled shared memory allocator using an smart adaptive pool. Includes
-//!a reference count but the class does not delete itself, this is
-//!responsibility of user classes. Node size (NodeSize) and the number of
-//!nodes allocated per chunk (NodesPerChunk) are known at compile time.
 template< class SegmentManager
         , std::size_t NodeSize
         , std::size_t NodesPerChunk
         , std::size_t MaxFreeChunks
+ , unsigned char OverheadPercent
>
 class private_adaptive_node_pool
    : public private_adaptive_node_pool_impl
@@ -448,8 +561,8 @@
    static const std::size_t nodes_per_chunk = NodesPerChunk;
 
    //!Constructor from a segment manager. Never throws
- private_adaptive_node_pool(segment_manager *segmeng_mngr)
- : base_t(segmeng_mngr, NodeSize, NodesPerChunk, MaxFreeChunks)
+ private_adaptive_node_pool(segment_manager *segment_mngr)
+ : base_t(segment_mngr, NodeSize, NodesPerChunk, MaxFreeChunks, OverheadPercent)
    {}
 
    //!Returns the segment manager. Never throws
@@ -462,117 +575,25 @@
 //!responsibility of user classes. Node size (NodeSize) and the number of
 //!nodes allocated per chunk (NodesPerChunk) are known at compile time
 template< class SegmentManager
- , class Mutex
         , std::size_t NodeSize
         , std::size_t NodesPerChunk
         , std::size_t MaxFreeChunks
+ , unsigned char OverheadPercent
>
 class shared_adaptive_node_pool
- : public private_adaptive_node_pool
- <SegmentManager, NodeSize, NodesPerChunk, MaxFreeChunks>
+ : public detail::shared_pool_impl
+ < private_adaptive_node_pool
+ <SegmentManager, NodeSize, NodesPerChunk, MaxFreeChunks, OverheadPercent>
+ >
 {
- private:
- typedef typename SegmentManager::void_pointer void_pointer;
- typedef private_adaptive_node_pool
- <SegmentManager,
- NodeSize, NodesPerChunk, MaxFreeChunks> private_node_allocator_t;
- public:
- //!Segment manager typedef
- typedef SegmentManager segment_manager;
- typedef typename private_node_allocator_t::free_nodes_t free_nodes_t;
-
- //!Constructor from a segment manager. Never throws
- shared_adaptive_node_pool(segment_manager *segment_mgnr)
- : private_node_allocator_t(segment_mgnr){}
-
- //!Destructor. Deallocates all allocated chunks. Never throws
- ~shared_adaptive_node_pool()
+ typedef detail::shared_pool_impl
+ < private_adaptive_node_pool
+ <SegmentManager, NodeSize, NodesPerChunk, MaxFreeChunks, OverheadPercent>
+ > base_t;
+ public:
+ shared_adaptive_node_pool(SegmentManager *segment_mgnr)
+ : base_t(segment_mgnr)
    {}
-
- //!Allocates array of count elements. Can throw boost::interprocess::bad_alloc
- void *allocate(std::size_t count)
- {
- //-----------------------
- boost::interprocess::scoped_lock<Mutex> guard(m_header);
- //-----------------------
- return private_node_allocator_t::allocate(count);
- }
-
- //!Deallocates an array pointed by ptr. Never throws
- void deallocate(void *ptr, std::size_t count)
- {
- //-----------------------
- boost::interprocess::scoped_lock<Mutex> guard(m_header);
- //-----------------------
- private_node_allocator_t::deallocate(ptr, count);
- }
-
- //!Allocates a singly linked list of n nodes ending in null pointer.
- //!can throw boost::interprocess::bad_alloc
- void allocate_nodes(std::size_t n, free_nodes_t &nodes)
- {
- //-----------------------
- boost::interprocess::scoped_lock<Mutex> guard(m_header);
- //-----------------------
- return private_node_allocator_t::allocate_nodes(n, nodes);
- }
-
- //!Deallocates a linked list of nodes ending in null pointer. Never throws
- void deallocate_nodes(free_nodes_t &nodes, std::size_t num)
- {
- //-----------------------
- boost::interprocess::scoped_lock<Mutex> guard(m_header);
- //-----------------------
- private_node_allocator_t::deallocate_nodes(nodes, num);
- }
-
- //!Deallocates a linked list of nodes ending in null pointer. Never throws
- void deallocate_nodes(free_nodes_t &nodes)
- {
- //-----------------------
- boost::interprocess::scoped_lock<Mutex> guard(m_header);
- //-----------------------
- private_node_allocator_t::deallocate_nodes(nodes);
- }
-
- //!Deallocates all the free chunks of memory. Never throws
- void deallocate_free_chunks()
- {
- //-----------------------
- boost::interprocess::scoped_lock<Mutex> guard(m_header);
- //-----------------------
- private_node_allocator_t::deallocate_free_chunks();
- }
-
- //!Increments internal reference count and returns new count. Never throws
- std::size_t inc_ref_count()
- {
- //-----------------------
- boost::interprocess::scoped_lock<Mutex> guard(m_header);
- //-----------------------
- return ++m_header.m_usecount;
- }
-
- //!Decrements internal reference count and returns new count. Never throws
- std::size_t dec_ref_count()
- {
- //-----------------------
- boost::interprocess::scoped_lock<Mutex> guard(m_header);
- //-----------------------
- assert(m_header.m_usecount > 0);
- return --m_header.m_usecount;
- }
-
- private:
- //!This struct includes needed data and derives from
- //!interprocess_mutex to allow EBO when using null_mutex
- struct header_t : Mutex
- {
- std::size_t m_usecount; //Number of attached allocators
-
- header_t()
- : m_usecount(0) {}
- } m_header;
 };
 
 } //namespace detail {

Modified: branches/fix-links/boost/interprocess/allocators/detail/node_pool.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/allocators/detail/node_pool.hpp (original)
+++ branches/fix-links/boost/interprocess/allocators/detail/node_pool.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -24,7 +24,9 @@
 #include <boost/intrusive/slist.hpp>
 #include <boost/math/common_factor_ct.hpp>
 #include <boost/interprocess/detail/math_functions.hpp>
+#include <boost/interprocess/detail/type_traits.hpp>
 #include <boost/interprocess/allocators/detail/node_tools.hpp>
+#include <boost/interprocess/allocators/detail/allocator_common.hpp>
 #include <cstddef>
 #include <functional>
 #include <algorithm>
@@ -51,10 +53,14 @@
    typedef typename node_slist<void_pointer>::slist_hook_t slist_hook_t;
    typedef typename node_slist<void_pointer>::node_t node_t;
    typedef typename node_slist<void_pointer>::node_slist_t free_nodes_t;
+ typedef typename SegmentManagerBase::multiallocation_iterator multiallocation_iterator;
+ typedef typename SegmentManagerBase::multiallocation_chain multiallocation_chain;
 
    private:
- typedef typename bi::make_slist < node_t, bi::base_hook<slist_hook_t>
- , bi::constant_time_size<false> >::type chunkslist_t;
+ typedef typename bi::make_slist
+ < node_t, bi::base_hook<slist_hook_t>
+ , bi::linear<true>
+ , bi::constant_time_size<false> >::type chunkslist_t;
    public:
 
    //!Segment manager typedef
@@ -62,10 +68,8 @@
 
    //!Constructor from a segment manager. Never throws
    private_node_pool_impl(segment_manager_base_type *segment_mngr_base, std::size_t node_size, std::size_t nodes_per_chunk)
- : m_node_size(node_size)
- , m_nodes_per_chunk(nodes_per_chunk)
- , m_real_node_size(detail::lcm(node_size, sizeof(node_t)))
- , m_block_size(detail::get_rounded_size(m_real_node_size*m_nodes_per_chunk, sizeof(node_t)))
+ : m_nodes_per_chunk(nodes_per_chunk)
+ , m_real_node_size(detail::lcm(node_size, std::size_t(alignment_of<node_t>::value)))
       //General purpose allocator
    , mp_segment_mngr_base(segment_mngr_base)
    , m_chunklist()
@@ -76,7 +80,7 @@
 
    //!Destructor. Deallocates all allocated chunks. Never throws
    ~private_node_pool_impl()
- { priv_clear(); }
+ { this->purge_chunks(); }
 
    std::size_t get_real_num_node() const
    { return m_nodes_per_chunk; }
@@ -86,116 +90,73 @@
    { return detail::get_pointer(mp_segment_mngr_base); }
 
    //!Allocates array of count elements. Can throw boost::interprocess::bad_alloc
- void *allocate(std::size_t count)
- {
- std::size_t bytes = count*m_node_size;
- if(bytes > m_real_node_size){//Normal allocation, no pooling used
- void *addr = mp_segment_mngr_base->allocate(bytes);
- if(!addr) throw bad_alloc();
- return addr;
- }
- else //Node allocation, pooling used
- return priv_alloc_node();
- }
+ void *allocate_node()
+ { return priv_alloc_node(); }
    
    //!Deallocates an array pointed by ptr. Never throws
- void deallocate(void *ptr, std::size_t count)
+ void deallocate_node(void *ptr)
+ { priv_dealloc_node(ptr); }
+
+ //!Allocates a singly linked list of n nodes ending in null pointer and pushes them in the chain.
+ //!can throw boost::interprocess::bad_alloc
+ void allocate_nodes(multiallocation_chain &nodes, const std::size_t n)
    {
- std::size_t bytes = count*m_node_size;
- if(bytes > m_real_node_size)//Normal allocation was used
- mp_segment_mngr_base->deallocate(ptr);
- else //Node allocation was used
- priv_dealloc_node(ptr);
+ std::size_t i = 0;
+ try{
+ for(; i < n; ++i){
+ nodes.push_front(priv_alloc_node());
+ }
+ }
+ catch(...){
+ this->deallocate_nodes(nodes, i);
+ throw;
+ }
    }
 
- //!Allocates a singly linked list of n nodes ending in null pointer.
+ //!Allocates a singly linked list of n nodes ending in null pointer
    //!can throw boost::interprocess::bad_alloc
- void allocate_nodes(const std::size_t n, free_nodes_t &nodes)
+ multiallocation_iterator allocate_nodes(const std::size_t n)
    {
+ multiallocation_chain nodes;
       std::size_t i = 0;
       try{
          for(; i < n; ++i){
- nodes.push_front(*priv_alloc_node());
+ nodes.push_front(priv_alloc_node());
          }
       }
       catch(...){
- priv_deallocate_nodes(nodes, i);
+ this->deallocate_nodes(nodes, i);
          throw;
       }
+ return nodes.get_it();
    }
 
    //!Deallocates a linked list of nodes. Never throws
- void deallocate_nodes(free_nodes_t &nodes)
- { priv_deallocate_nodes(nodes, nodes.size()); }
+ void deallocate_nodes(multiallocation_chain &nodes)
+ { this->deallocate_nodes(nodes.get_it()); }
 
    //!Deallocates the first n nodes of a linked list of nodes. Never throws
- void deallocate_nodes(free_nodes_t &nodes, std::size_t n)
- { priv_deallocate_nodes(nodes, n); }
-
- //!Deallocates all the free chunks of memory. Never throws
- void deallocate_free_chunks()
- { priv_deallocate_free_chunks(); }
-
- std::size_t num_free_nodes()
- { return m_freelist.size(); }
-
- void swap(private_node_pool_impl &other)
- {
- std::swap(mp_segment_mngr_base, other.mp_segment_mngr_base);
- m_chunklist.swap(other.m_chunklist);
- m_freelist.swap(other.m_freelist);
- std::swap(m_allocated, other.m_allocated);
- }
-
- private:
-
- void priv_deallocate_nodes(free_nodes_t &nodes, const std::size_t num)
+ void deallocate_nodes(multiallocation_chain &nodes, std::size_t num)
    {
       assert(nodes.size() >= num);
       for(std::size_t i = 0; i < num; ++i){
- node_t *to_deallocate = &nodes.front();
- nodes.pop_front();
- deallocate(to_deallocate, 1);
+ deallocate_node(nodes.pop_front());
       }
    }
 
- struct push_in_list
- {
- push_in_list(free_nodes_t &l, typename free_nodes_t::iterator &it)
- : slist_(l), last_it_(it)
- {}
-
- void operator()(typename free_nodes_t::pointer p) const
- {
- slist_.push_front(*p);
- if(slist_.size() == 1){ //Cache last element
- ++last_it_ = slist_.begin();
- }
- }
-
- private:
- free_nodes_t &slist_;
- typename free_nodes_t::iterator &last_it_;
- };
-
- struct is_between
- : std::unary_function<typename free_nodes_t::value_type, bool>
+ //!Deallocates the nodes pointed by the multiallocation iterator. Never throws
+ void deallocate_nodes(multiallocation_iterator it)
    {
- is_between(const void *addr, std::size_t size)
- : beg_((const char *)addr), end_(beg_+size)
- {}
-
- bool operator()(typename free_nodes_t::const_reference v) const
- {
- return (beg_ <= (const char *)&v &&
- end_ > (const char *)&v);
+ multiallocation_iterator itend;
+ while(it != itend){
+ void *addr = &*it;
+ ++it;
+ deallocate_node(addr);
       }
- private:
- const char * beg_;
- const char * end_;
- };
+ }
 
- void priv_deallocate_free_chunks()
+ //!Deallocates all the free chunks of memory. Never throws
+ void deallocate_free_chunks()
    {
       typedef typename free_nodes_t::iterator nodelist_iterator;
       typename chunkslist_t::iterator bit(m_chunklist.before_begin()),
@@ -204,16 +165,19 @@
       free_nodes_t backup_list;
       nodelist_iterator backup_list_last = backup_list.before_begin();
 
+ //Execute the algorithm and get an iterator to the last value
+ std::size_t blocksize = detail::get_rounded_size
+ (m_real_node_size*m_nodes_per_chunk, alignment_of<node_t>::value);
+
       while(it != itend){
          //Collect all the nodes from the chunk pointed by it
          //and push them in the list
          free_nodes_t free_nodes;
          nodelist_iterator last_it = free_nodes.before_begin();
- const void *addr = get_chunk_from_hook(&*it);
+ const void *addr = get_chunk_from_hook(&*it, blocksize);
 
- //Execute the algorithm and get an iterator to the last value
          m_freelist.remove_and_dispose_if
- (is_between(addr, m_block_size), push_in_list(free_nodes, last_it));
+ (is_between(addr, blocksize), push_in_list(free_nodes, last_it));
 
          //If the number of nodes is equal to m_nodes_per_chunk
          //this means that the block can be deallocated
@@ -253,23 +217,76 @@
          , backup_list.size());
    }
 
- //!Deallocates all used memory. Never throws
- void priv_clear()
+ std::size_t num_free_nodes()
+ { return m_freelist.size(); }
+
+ //!Deallocates all used memory. Precondition: all nodes allocated from this pool should
+ //!already be deallocated. Otherwise, undefined behaviour. Never throws
+ void purge_chunks()
    {
       //check for memory leaks
       assert(m_allocated==0);
-
+ std::size_t blocksize = detail::get_rounded_size
+ (m_real_node_size*m_nodes_per_chunk, alignment_of<node_t>::value);
       typename chunkslist_t::iterator
          it(m_chunklist.begin()), itend(m_chunklist.end()), aux;
 
       //We iterate though the NodeBlock list to free the memory
       while(!m_chunklist.empty()){
- void *addr = get_chunk_from_hook(&m_chunklist.front());
+ void *addr = get_chunk_from_hook(&m_chunklist.front(), blocksize);
          m_chunklist.pop_front();
          mp_segment_mngr_base->deallocate(addr);
- }
+ }
+ //Just clear free node list
+ m_freelist.clear();
    }
 
+ void swap(private_node_pool_impl &other)
+ {
+ std::swap(mp_segment_mngr_base, other.mp_segment_mngr_base);
+ m_chunklist.swap(other.m_chunklist);
+ m_freelist.swap(other.m_freelist);
+ std::swap(m_allocated, other.m_allocated);
+ }
+
+ private:
+
+ struct push_in_list
+ {
+ push_in_list(free_nodes_t &l, typename free_nodes_t::iterator &it)
+ : slist_(l), last_it_(it)
+ {}
+
+ void operator()(typename free_nodes_t::pointer p) const
+ {
+ slist_.push_front(*p);
+ if(slist_.size() == 1){ //Cache last element
+ ++last_it_ = slist_.begin();
+ }
+ }
+
+ private:
+ free_nodes_t &slist_;
+ typename free_nodes_t::iterator &last_it_;
+ };
+
+ struct is_between
+ : std::unary_function<typename free_nodes_t::value_type, bool>
+ {
+ is_between(const void *addr, std::size_t size)
+ : beg_((const char *)addr), end_(beg_+size)
+ {}
+
+ bool operator()(typename free_nodes_t::const_reference v) const
+ {
+ return (beg_ <= (const char *)&v &&
+ end_ > (const char *)&v);
+ }
+ private:
+ const char * beg_;
+ const char * end_;
+ };
+
    //!Allocates one node, using single segregated storage algorithm.
    //!Never throws
    node_t *priv_alloc_node()
@@ -300,10 +317,13 @@
    {
       //We allocate a new NodeBlock and put it as first
       //element in the free Node list
- char *pNode = detail::char_ptr_cast(mp_segment_mngr_base->allocate(m_block_size + sizeof(node_t)));
+ std::size_t blocksize =
+ detail::get_rounded_size(m_real_node_size*m_nodes_per_chunk, alignment_of<node_t>::value);
+ char *pNode = detail::char_ptr_cast
+ (mp_segment_mngr_base->allocate(blocksize + sizeof(node_t)));
       if(!pNode) throw bad_alloc();
       char *pBlock = pNode;
- m_chunklist.push_front(get_chunk_hook(pBlock));
+ m_chunklist.push_front(get_chunk_hook(pBlock, blocksize));
 
       //We initialize all Nodes in Node Block to insert
       //them in the free Node list
@@ -314,26 +334,24 @@
 
    private:
    //!Returns a reference to the chunk hook placed in the end of the chunk
- inline node_t & get_chunk_hook (void *chunk)
+ static inline node_t & get_chunk_hook (void *chunk, std::size_t blocksize)
    {
       return *static_cast<node_t*>(
- static_cast<void*>((detail::char_ptr_cast(chunk)+m_block_size)));
+ static_cast<void*>((detail::char_ptr_cast(chunk) + blocksize)));
    }
 
    //!Returns the starting address of the chunk reference to the chunk hook placed in the end of the chunk
- inline void *get_chunk_from_hook (node_t *hook)
+ inline void *get_chunk_from_hook (node_t *hook, std::size_t blocksize)
    {
- return static_cast<void*>((detail::char_ptr_cast(hook) - m_block_size));
+ return static_cast<void*>((detail::char_ptr_cast(hook) - blocksize));
    }
 
    private:
    typedef typename pointer_to_other
       <void_pointer, segment_manager_base_type>::type segment_mngr_base_ptr_t;
 
- const std::size_t m_node_size;
    const std::size_t m_nodes_per_chunk;
    const std::size_t m_real_node_size;
- const std::size_t m_block_size;
    segment_mngr_base_ptr_t mp_segment_mngr_base; //Segment manager
    chunkslist_t m_chunklist; //Intrusive container of chunks
    free_nodes_t m_freelist; //Intrusive container of free nods
@@ -376,114 +394,28 @@
 //!a reference count but the class does not delete itself, this is
 //!responsibility of user classes. Node size (NodeSize) and the number of
 //!nodes allocated per chunk (NodesPerChunk) are known at compile time
+//!Pooled shared memory allocator using adaptive pool. Includes
+//!a reference count but the class does not delete itself, this is
+//!responsibility of user classes. Node size (NodeSize) and the number of
+//!nodes allocated per chunk (NodesPerChunk) are known at compile time
 template< class SegmentManager
- , class Mutex
         , std::size_t NodeSize
         , std::size_t NodesPerChunk
>
 class shared_node_pool
- : public private_node_pool<SegmentManager, NodeSize, NodesPerChunk>
+ : public detail::shared_pool_impl
+ < private_node_pool
+ <SegmentManager, NodeSize, NodesPerChunk>
+ >
 {
- private:
- typedef typename SegmentManager::void_pointer void_pointer;
- typedef private_node_pool
- <SegmentManager, NodeSize, NodesPerChunk> private_node_allocator_t;
-
+ typedef detail::shared_pool_impl
+ < private_node_pool
+ <SegmentManager, NodeSize, NodesPerChunk>
+ > base_t;
    public:
- typedef SegmentManager segment_manager;
- typedef typename private_node_allocator_t::free_nodes_t free_nodes_t;
-
- //!Constructor from a segment manager. Never throws
- shared_node_pool(segment_manager *segment_mngr)
- : private_node_allocator_t(segment_mngr){}
-
- //!Destructor. Deallocates all allocated chunks. Never throws
- ~shared_node_pool()
+ shared_node_pool(SegmentManager *segment_mgnr)
+ : base_t(segment_mgnr)
    {}
-
- //!Allocates array of count elements. Can throw boost::interprocess::bad_alloc
- void *allocate(std::size_t count)
- {
- //-----------------------
- boost::interprocess::scoped_lock<Mutex> guard(m_header);
- //-----------------------
- return private_node_allocator_t::allocate(count);
- }
-
- //!Deallocates an array pointed by ptr. Never throws
- void deallocate(void *ptr, std::size_t count)
- {
- //-----------------------
- boost::interprocess::scoped_lock<Mutex> guard(m_header);
- //-----------------------
- private_node_allocator_t::deallocate(ptr, count);
- }
-
- //!Allocates a singly linked list of n nodes ending in null pointer.
- //!can throw boost::interprocess::bad_alloc
- void allocate_nodes(const std::size_t n, free_nodes_t &nodes)
- {
- //-----------------------
- boost::interprocess::scoped_lock<Mutex> guard(m_header);
- //-----------------------
- private_node_allocator_t::allocate_nodes(n, nodes);
- }
-
- //!Deallocates a linked list of nodes ending in null pointer. Never throws
- void deallocate_nodes(free_nodes_t &nodes, std::size_t n)
- {
- //-----------------------
- boost::interprocess::scoped_lock<Mutex> guard(m_header);
- //-----------------------
- private_node_allocator_t::deallocate_nodes(nodes, n);
- }
-
- void deallocate_nodes(free_nodes_t &nodes)
- {
- //-----------------------
- boost::interprocess::scoped_lock<Mutex> guard(m_header);
- //-----------------------
- private_node_allocator_t::deallocate_nodes(nodes);
- }
-
- //!Deallocates all the free chunks of memory. Never throws
- void deallocate_free_chunks()
- {
- //-----------------------
- boost::interprocess::scoped_lock<Mutex> guard(m_header);
- //-----------------------
- private_node_allocator_t::deallocate_free_chunks();
- }
-
- //!Increments internal reference count and returns new count. Never throws
- std::size_t inc_ref_count()
- {
- //-----------------------
- boost::interprocess::scoped_lock<Mutex> guard(m_header);
- //-----------------------
- return ++m_header.m_usecount;
- }
-
- //!Decrements internal reference count and returns new count. Never throws
- std::size_t dec_ref_count()
- {
- //-----------------------
- boost::interprocess::scoped_lock<Mutex> guard(m_header);
- //-----------------------
- assert(m_header.m_usecount > 0);
- return --m_header.m_usecount;
- }
-
- private:
- //!This struct includes needed data and derives from
- //!interprocess_mutex to allow EBO when using null_mutex
- struct header_t : Mutex
- {
- std::size_t m_usecount; //Number of attached allocators
-
- header_t()
- : m_usecount(0) {}
- } m_header;
 };
 
 } //namespace detail {

Modified: branches/fix-links/boost/interprocess/allocators/detail/node_tools.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/allocators/detail/node_tools.hpp (original)
+++ branches/fix-links/boost/interprocess/allocators/detail/node_tools.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2007-2008. 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)
 //
@@ -37,7 +37,8 @@
       : public slist_hook_t
    {};
 
- typedef typename bi::make_slist<node_t, bi::base_hook<slist_hook_t> >::type node_slist_t;
+ typedef typename bi::make_slist
+ <node_t, bi::linear<true>, bi::base_hook<slist_hook_t> >::type node_slist_t;
 };
 
 } //namespace detail {

Modified: branches/fix-links/boost/interprocess/allocators/node_allocator.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/allocators/node_allocator.hpp (original)
+++ branches/fix-links/boost/interprocess/allocators/node_allocator.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -8,8 +8,8 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 
-#ifndef BOOST_INTERPROCESS_POOLED_NODE_ALLOCATOR_HPP
-#define BOOST_INTERPROCESS_POOLED_NODE_ALLOCATOR_HPP
+#ifndef BOOST_INTERPROCESS_NODE_ALLOCATOR_HPP
+#define BOOST_INTERPROCESS_NODE_ALLOCATOR_HPP
 
 #if (defined _MSC_VER) && (_MSC_VER >= 1200)
 # pragma once
@@ -22,9 +22,10 @@
 #include <boost/assert.hpp>
 #include <boost/utility/addressof.hpp>
 #include <boost/interprocess/detail/utilities.hpp>
-#include <boost/interprocess/detail/workaround.hpp>
+#include <boost/interprocess/detail/type_traits.hpp>
 #include <boost/interprocess/allocators/detail/node_pool.hpp>
 #include <boost/interprocess/exceptions.hpp>
+#include <boost/interprocess/allocators/detail/allocator_common.hpp>
 #include <memory>
 #include <algorithm>
 #include <cstddef>
@@ -35,6 +36,177 @@
 namespace boost {
 namespace interprocess {
 
+/// @cond
+
+namespace detail{
+
+template < unsigned int Version
+ , class T
+ , class SegmentManager
+ , std::size_t NodesPerChunk
+ >
+class node_allocator_base
+ : public node_pool_allocation_impl
+ < node_allocator_base
+ < Version, T, SegmentManager, NodesPerChunk>
+ , Version
+ , T
+ , SegmentManager
+ >
+{
+ public:
+ typedef typename SegmentManager::void_pointer void_pointer;
+ typedef SegmentManager segment_manager;
+ typedef node_allocator_base
+ <Version, T, SegmentManager, NodesPerChunk> self_t;
+ typedef detail::shared_node_pool
+ < SegmentManager, sizeof(T), NodesPerChunk> node_pool_t;
+ typedef typename detail::
+ pointer_to_other<void_pointer, node_pool_t>::type node_pool_ptr;
+
+ BOOST_STATIC_ASSERT((Version <=2));
+
+ public:
+ //-------
+ typedef typename detail::
+ pointer_to_other<void_pointer, T>::type pointer;
+ typedef typename detail::
+ pointer_to_other<void_pointer, const T>::type const_pointer;
+ typedef T value_type;
+ typedef typename detail::add_reference
+ <value_type>::type reference;
+ typedef typename detail::add_reference
+ <const value_type>::type const_reference;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+
+ typedef detail::version_type<node_allocator_base, Version> version;
+ typedef transform_iterator
+ < typename SegmentManager::
+ multiallocation_iterator
+ , detail::cast_functor <T> > multiallocation_iterator;
+ typedef typename SegmentManager::
+ multiallocation_chain multiallocation_chain;
+
+ //!Obtains node_allocator_base from
+ //!node_allocator_base
+ template<class T2>
+ struct rebind
+ {
+ typedef node_allocator_base<Version, T2, SegmentManager, NodesPerChunk> other;
+ };
+
+ /// @cond
+ private:
+ //!Not assignable from related node_allocator_base
+ template<unsigned int Version2, class T2, class SegmentManager2, std::size_t N2>
+ node_allocator_base& operator=
+ (const node_allocator_base<Version2, T2, SegmentManager2, N2>&);
+
+ //!Not assignable from other node_allocator_base
+ node_allocator_base& operator=(const node_allocator_base&);
+ /// @endcond
+
+ public:
+ //!Constructor from a segment manager. If not present, constructs a node
+ //!pool. Increments the reference count of the associated node pool.
+ //!Can throw boost::interprocess::bad_alloc
+ node_allocator_base(segment_manager *segment_mngr)
+ : mp_node_pool(detail::get_or_create_node_pool<node_pool_t>(segment_mngr)) { }
+
+ //!Copy constructor from other node_allocator_base. Increments the reference
+ //!count of the associated node pool. Never throws
+ node_allocator_base(const node_allocator_base &other)
+ : mp_node_pool(other.get_node_pool())
+ {
+ mp_node_pool->inc_ref_count();
+ }
+
+ //!Copy constructor from related node_allocator_base. If not present, constructs
+ //!a node pool. Increments the reference count of the associated node pool.
+ //!Can throw boost::interprocess::bad_alloc
+ template<class T2>
+ node_allocator_base
+ (const node_allocator_base<Version, T2, SegmentManager, NodesPerChunk> &other)
+ : mp_node_pool(detail::get_or_create_node_pool<node_pool_t>(other.get_segment_manager())) { }
+
+ //!Destructor, removes node_pool_t from memory
+ //!if its reference count reaches to zero. Never throws
+ ~node_allocator_base()
+ { detail::destroy_node_pool_if_last_link(detail::get_pointer(mp_node_pool)); }
+
+ //!Returns a pointer to the node pool.
+ //!Never throws
+ node_pool_t* get_node_pool() const
+ { return detail::get_pointer(mp_node_pool); }
+
+ //!Returns the segment manager.
+ //!Never throws
+ segment_manager* get_segment_manager()const
+ { return mp_node_pool->get_segment_manager(); }
+
+ //!Swaps allocators. Does not throw. If each allocator is placed in a
+ //!different memory segment, the result is undefined.
+ friend void swap(self_t &alloc1, self_t &alloc2)
+ { detail::do_swap(alloc1.mp_node_pool, alloc2.mp_node_pool); }
+
+ /// @cond
+ private:
+ node_pool_ptr mp_node_pool;
+ /// @endcond
+};
+
+//!Equality test for same type
+//!of node_allocator_base
+template<unsigned int V, class T, class S, std::size_t NodesPerChunk> inline
+bool operator==(const node_allocator_base<V, T, S, NodesPerChunk> &alloc1,
+ const node_allocator_base<V, T, S, NodesPerChunk> &alloc2)
+ { return alloc1.get_node_pool() == alloc2.get_node_pool(); }
+
+//!Inequality test for same type
+//!of node_allocator_base
+template<unsigned int V, class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
+bool operator!=(const node_allocator_base<V, T, S, NodesPerChunk> &alloc1,
+ const node_allocator_base<V, T, S, NodesPerChunk> &alloc2)
+ { return alloc1.get_node_pool() != alloc2.get_node_pool(); }
+
+template < class T
+ , class SegmentManager
+ , std::size_t NodesPerChunk = 64
+ >
+class node_allocator_v1
+ : public node_allocator_base
+ < 1
+ , T
+ , SegmentManager
+ , NodesPerChunk
+ >
+{
+ public:
+ typedef detail::node_allocator_base
+ < 1, T, SegmentManager, NodesPerChunk> base_t;
+
+ template<class T2>
+ struct rebind
+ {
+ typedef node_allocator_v1<T2, SegmentManager, NodesPerChunk> other;
+ };
+
+ node_allocator_v1(SegmentManager *segment_mngr)
+ : base_t(segment_mngr)
+ {}
+
+ template<class T2>
+ node_allocator_v1
+ (const node_allocator_v1<T2, SegmentManager, NodesPerChunk> &other)
+ : base_t(other)
+ {}
+};
+
+} //namespace detail{
+
+/// @endcond
+
 //!An STL node allocator that uses a segment manager as memory
 //!source. The internal pointer type will of the same type (raw, smart) as
 //!"typename SegmentManager::void_pointer" type. This allows
@@ -43,25 +215,49 @@
 //!of node_allocator with equal sizeof(T) placed in the same segment
 //!group. NodesPerChunk is the number of nodes allocated at once when the allocator
 //!needs runs out of nodes
-template<class T, class SegmentManager, std::size_t NodesPerChunk>
+template < class T
+ , class SegmentManager
+ , std::size_t NodesPerChunk
+ >
 class node_allocator
+ /// @cond
+ : public detail::node_allocator_base
+ < 2
+ , T
+ , SegmentManager
+ , NodesPerChunk
+ >
+ /// @endcond
 {
+
+ #ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
+ typedef detail::node_allocator_base
+ < 2, T, SegmentManager, NodesPerChunk> base_t;
    public:
- typedef typename SegmentManager::void_pointer void_pointer;
- typedef typename detail::
- pointer_to_other<void_pointer, const void>::type cvoid_pointer;
- typedef SegmentManager segment_manager;
- typedef typename SegmentManager::
- mutex_family::mutex_type mutex_type;
- typedef node_allocator
- <T, SegmentManager, NodesPerChunk> self_t;
+ typedef detail::version_type<node_allocator, 2> version;
+
+ template<class T2>
+ struct rebind
+ {
+ typedef node_allocator<T2, SegmentManager, NodesPerChunk> other;
+ };
+
+ node_allocator(SegmentManager *segment_mngr)
+ : base_t(segment_mngr)
+ {}
 
+ template<class T2>
+ node_allocator
+ (const node_allocator<T2, SegmentManager, NodesPerChunk> &other)
+ : base_t(other)
+ {}
+
+ #else //BOOST_INTERPROCESS_DOXYGEN_INVOKED
    public:
- //-------
- typedef typename detail::
- pointer_to_other<void_pointer, T>::type pointer;
- typedef typename detail::
- pointer_to_other<void_pointer, const T>::type const_pointer;
+ typedef implementation_defined::segment_manager segment_manager;
+ typedef segment_manager::void_pointer void_pointer;
+ typedef implementation_defined::pointer pointer;
+ typedef implementation_defined::const_pointer const_pointer;
    typedef T value_type;
    typedef typename detail::add_reference
                      <value_type>::type reference;
@@ -69,225 +265,170 @@
                      <const value_type>::type const_reference;
    typedef std::size_t size_type;
    typedef std::ptrdiff_t difference_type;
- typedef detail::shared_node_pool
- < SegmentManager, mutex_type
- , sizeof(T), NodesPerChunk> node_pool_t;
- typedef typename detail::
- pointer_to_other<void_pointer, node_pool_t>::type node_pool_ptr;
 
- //!Obtains node_allocator from other
+ //!Obtains node_allocator from
    //!node_allocator
    template<class T2>
    struct rebind
    {
- typedef node_allocator<T2, SegmentManager, NodesPerChunk> other;
+ typedef node_allocator<T2, SegmentManager, NodesPerChunk> other;
    };
 
- /// @cond
    private:
- //!Not assignable from related
- //!node_allocator
+ //!Not assignable from
+ //!related node_allocator
    template<class T2, class SegmentManager2, std::size_t N2>
    node_allocator& operator=
       (const node_allocator<T2, SegmentManager2, N2>&);
 
- //!Not assignable from other
- //!node_allocator
+ //!Not assignable from
+ //!other node_allocator
    node_allocator& operator=(const node_allocator&);
- /// @endcond
 
    public:
-
    //!Constructor from a segment manager. If not present, constructs a node
    //!pool. Increments the reference count of the associated node pool.
    //!Can throw boost::interprocess::bad_alloc
- node_allocator(segment_manager *segment_mngr)
- : mp_node_pool(priv_get_or_create(segment_mngr))
- {}
+ node_allocator(segment_manager *segment_mngr);
 
    //!Copy constructor from other node_allocator. Increments the reference
    //!count of the associated node pool. Never throws
- node_allocator(const node_allocator &other)
- : mp_node_pool(other.get_node_pool())
- { mp_node_pool->inc_ref_count(); }
+ node_allocator(const node_allocator &other);
 
    //!Copy constructor from related node_allocator. If not present, constructs
    //!a node pool. Increments the reference count of the associated node pool.
    //!Can throw boost::interprocess::bad_alloc
    template<class T2>
    node_allocator
- (const node_allocator<T2, SegmentManager, NodesPerChunk> &other)
- : mp_node_pool(priv_get_or_create(other.get_segment_manager()))
- {}
+ (const node_allocator<T2, SegmentManager, NodesPerChunk> &other);
 
    //!Destructor, removes node_pool_t from memory
    //!if its reference count reaches to zero. Never throws
- ~node_allocator()
- { priv_destroy_if_last_link(); }
+ ~node_allocator();
 
    //!Returns a pointer to the node pool.
    //!Never throws
- node_pool_t* get_node_pool() const
- { return detail::get_pointer(mp_node_pool); }
+ node_pool_t* get_node_pool() const;
 
    //!Returns the segment manager.
    //!Never throws
- segment_manager* get_segment_manager()const
- { return mp_node_pool->get_segment_manager(); }
+ segment_manager* get_segment_manager()const;
 
- //!Returns the number of elements that could be allocated. Never throws
- size_type max_size() const
- { return this->get_segment_manager()->get_size()/sizeof(value_type); }
+ //!Returns the number of elements that could be allocated.
+ //!Never throws
+ size_type max_size() const;
 
    //!Allocate memory for an array of count elements.
    //!Throws boost::interprocess::bad_alloc if there is no enough memory
- pointer allocate(size_type count, cvoid_pointer = 0)
- {
- if(count > ((size_type)-1)/sizeof(value_type))
- throw bad_alloc();
- return pointer(static_cast<T*>(mp_node_pool->allocate(count)));
- }
+ pointer allocate(size_type count, cvoid_pointer hint = 0);
 
    //!Deallocate allocated memory.
    //!Never throws
- void deallocate(const pointer &ptr, size_type count)
- { mp_node_pool->deallocate(detail::get_pointer(ptr), count); }
+ void deallocate(const pointer &ptr, size_type count);
 
- //!Deallocates all free chunks of the pool
- void deallocate_free_chunks()
- { mp_node_pool->deallocate_free_chunks(); }
+ //!Deallocates all free chunks
+ //!of the pool
+ void deallocate_free_chunks();
 
    //!Swaps allocators. Does not throw. If each allocator is placed in a
    //!different memory segment, the result is undefined.
- friend void swap(self_t &alloc1, self_t &alloc2)
- { detail::do_swap(alloc1.mp_node_pool, alloc2.mp_node_pool); }
-
- //These functions are obsolete. These are here to conserve
- //backwards compatibility with containers using them...
+ friend void swap(self_t &alloc1, self_t &alloc2);
 
    //!Returns address of mutable object.
    //!Never throws
- pointer address(reference value) const
- { return pointer(boost::addressof(value)); }
+ pointer address(reference value) const;
 
    //!Returns address of non mutable object.
    //!Never throws
- const_pointer address(const_reference value) const
- { return const_pointer(boost::addressof(value)); }
+ const_pointer address(const_reference value) const;
 
    //!Default construct an object.
- //!Throws if T's default constructor throws*/
- void construct(const pointer &ptr)
- { new(detail::get_pointer(ptr)) value_type; }
+ //!Throws if T's default constructor throws
+ void construct(const pointer &ptr);
 
    //!Destroys object. Throws if object's
    //!destructor throws
- void destroy(const pointer &ptr)
- { BOOST_ASSERT(ptr != 0); (*ptr).~value_type(); }
-
- /// @cond
- private:
- //!Object function that creates the node allocator if it is not created and
- //!increments reference count if it is already created
- struct get_or_create_func
- {
- typedef detail::shared_node_pool
- <SegmentManager, mutex_type, sizeof(T), NodesPerChunk> node_pool_t;
-
- //!This connects or constructs the unique instance of node_pool_t
- //!Can throw boost::interprocess::bad_alloc
- void operator()()
- {
- //Find or create the node_pool_t
- mp_node_pool = mp_named_alloc->template find_or_construct
- <node_pool_t>(unique_instance)(mp_named_alloc);
- //If valid, increment link count
- if(mp_node_pool != 0)
- mp_node_pool->inc_ref_count();
- }
-
- //!Constructor. Initializes function
- //!object parameters
- get_or_create_func(segment_manager *hdr) : mp_named_alloc(hdr){}
-
- node_pool_t *mp_node_pool;
- segment_manager *mp_named_alloc;
- };
-
- //!Initialization function, creates an executes atomically the
- //!initialization object functions. Can throw boost::interprocess::bad_alloc
- node_pool_t *priv_get_or_create(segment_manager *named_alloc)
- {
- get_or_create_func func(named_alloc);
- named_alloc->atomic_func(func);
- return func.mp_node_pool;
- }
-
- //!Object function that decrements the reference count. If the count
- //!reaches to zero destroys the node allocator from memory.
- //!Never throws
- struct destroy_if_last_link_func
- {
- typedef detail::shared_node_pool
- <SegmentManager, mutex_type,sizeof(T), NodesPerChunk> node_pool_t;
-
- //!Decrements reference count and destroys the object if there is no
- //!more attached allocators. Never throws
- void operator()()
- {
- //If not the last link return
- if(mp_node_pool->dec_ref_count() != 0) return;
-
- //Last link, let's destroy the segment_manager
- mp_named_alloc->template destroy<node_pool_t>(unique_instance);
- }
-
- //!Constructor. Initializes function
- //!object parameters
- destroy_if_last_link_func(segment_manager *nhdr,
- node_pool_t *phdr)
- : mp_named_alloc(nhdr), mp_node_pool(phdr)
- {}
+ void destroy(const pointer &ptr);
 
- segment_manager *mp_named_alloc;
- node_pool_t *mp_node_pool;
- };
+ //!Returns maximum the number of objects the previously allocated memory
+ //!pointed by p can hold. This size only works for memory allocated with
+ //!allocate, allocation_command and allocate_many.
+ size_type size(const pointer &p) const;
+
+ std::pair<pointer, bool>
+ allocation_command(allocation_type command,
+ size_type limit_size,
+ size_type preferred_size,
+ size_type &received_size, const pointer &reuse = 0);
+
+ //!Allocates many elements of size elem_size in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. The elements must be deallocated
+ //!with deallocate(...)
+ multiallocation_iterator allocate_many(size_type elem_size, std::size_t num_elements);
+
+ //!Allocates n_elements elements, each one of size elem_sizes[i]in a
+ //!contiguous chunk
+ //!of memory. The elements must be deallocated
+ multiallocation_iterator allocate_many(const size_type *elem_sizes, size_type n_elements);
+
+ //!Allocates many elements of size elem_size in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. The elements must be deallocated
+ //!with deallocate(...)
+ void deallocate_many(multiallocation_iterator it);
 
- //!Destruction function, initializes and executes destruction function
- //!object. Never throws
- void priv_destroy_if_last_link()
- {
- typedef detail::shared_node_pool
- <SegmentManager, mutex_type,sizeof(T), NodesPerChunk> node_pool_t;
- //Get segment manager
- segment_manager *named_segment_mngr = this->get_segment_manager();
- //Execute destruction functor atomically
- destroy_if_last_link_func func(named_segment_mngr, detail::get_pointer(mp_node_pool));
- named_segment_mngr->atomic_func(func);
- }
+ //!Allocates just one object. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ //!Throws boost::interprocess::bad_alloc if there is no enough memory
+ pointer allocate_one();
 
- private:
- node_pool_ptr mp_node_pool;
- /// @endcond
+ //!Allocates many elements of size == 1 in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ multiallocation_iterator allocate_individual(std::size_t num_elements);
+
+ //!Deallocates memory previously allocated with allocate_one().
+ //!You should never use deallocate_one to deallocate memory allocated
+ //!with other functions different from allocate_one(). Never throws
+ void deallocate_one(const pointer &p);
+
+ //!Allocates many elements of size == 1 in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ void deallocate_individual(multiallocation_iterator it);
+ #endif
 };
 
-//!Equality test for same type of
-//!node_allocator
-template<class T, class S, std::size_t NodesPerChunk> inline
-bool operator==(const node_allocator<T, S, NodesPerChunk> &alloc1,
- const node_allocator<T, S, NodesPerChunk> &alloc2)
- { return alloc1.get_node_pool() == alloc2.get_node_pool(); }
+#ifdef BOOST_INTERPROCESS_DOXYGEN_INVOKED
 
-//!Inequality test for same type of
-//!node_allocator
-template<class T, class S, std::size_t NodesPerChunk> inline
-bool operator!=(const node_allocator<T, S, NodesPerChunk> &alloc1,
- const node_allocator<T, S, NodesPerChunk> &alloc2)
- { return alloc1.get_node_pool() != alloc2.get_node_pool(); }
+//!Equality test for same type
+//!of node_allocator
+template<class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
+bool operator==(const node_allocator<T, S, NodesPerChunk, F, OP> &alloc1,
+ const node_allocator<T, S, NodesPerChunk, F, OP> &alloc2);
+
+//!Inequality test for same type
+//!of node_allocator
+template<class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
+bool operator!=(const node_allocator<T, S, NodesPerChunk, F, OP> &alloc1,
+ const node_allocator<T, S, NodesPerChunk, F, OP> &alloc2);
+
+#endif
 
 } //namespace interprocess {
 } //namespace boost {
 
 #include <boost/interprocess/detail/config_end.hpp>
 
-#endif //#ifndef BOOST_INTERPROCESS_POOLED_NODE_ALLOCATOR_HPP
+#endif //#ifndef BOOST_INTERPROCESS_NODE_ALLOCATOR_HPP

Modified: branches/fix-links/boost/interprocess/allocators/private_adaptive_pool.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/allocators/private_adaptive_pool.hpp (original)
+++ branches/fix-links/boost/interprocess/allocators/private_adaptive_pool.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -30,38 +30,47 @@
 #include <cstddef>
 
 //!\file
-//!Describes private_adaptive_pool pooled shared memory STL compatible allocator
+//!Describes private_adaptive_pool_base pooled shared memory STL compatible allocator
 
 namespace boost {
 namespace interprocess {
 
-//!An STL node allocator that uses a segment manager as memory
-//!source. The internal pointer type will of the same type (raw, smart) as
-//!"typename SegmentManager::void_pointer" type. This allows
-//!placing the allocator in shared memory, memory mapped-files, etc...
-//!This allocator has its own node pool. NodesPerChunk is the minimum number of nodes
-//!allocated at once when the allocator needs runs out of nodes.
-template<class T, class SegmentManager, std::size_t NodesPerChunk, std::size_t MaxFreeChunks>
-class private_adaptive_pool
+/// @cond
+
+namespace detail {
+
+template < unsigned int Version
+ , class T
+ , class SegmentManager
+ , std::size_t NodesPerChunk
+ , std::size_t MaxFreeChunks
+ , unsigned char OverheadPercent
+ >
+class private_adaptive_pool_base
+ : public node_pool_allocation_impl
+ < private_adaptive_pool_base < Version, T, SegmentManager, NodesPerChunk
+ , MaxFreeChunks, OverheadPercent>
+ , Version
+ , T
+ , SegmentManager
+ >
 {
    /// @cond
    private:
    typedef typename SegmentManager::void_pointer void_pointer;
- typedef typename detail::
- pointer_to_other<void_pointer, const void>::type cvoid_pointer;
    typedef SegmentManager segment_manager;
- typedef typename detail::
- pointer_to_other<void_pointer, char>::type char_pointer;
- typedef typename detail::pointer_to_other
- <void_pointer, segment_manager>::type segment_mngr_ptr_t;
- typedef typename SegmentManager::
- mutex_family::mutex_type mutex_type;
- typedef private_adaptive_pool
- <T, SegmentManager, NodesPerChunk, MaxFreeChunks> self_t;
+ typedef private_adaptive_pool_base
+ < Version, T, SegmentManager, NodesPerChunk
+ , MaxFreeChunks, OverheadPercent> self_t;
    typedef detail::private_adaptive_node_pool
- <SegmentManager, sizeof(T)
- , NodesPerChunk, MaxFreeChunks> priv_node_pool_t;
+ <SegmentManager
+ , sizeof(T)
+ , NodesPerChunk
+ , MaxFreeChunks
+ , OverheadPercent
+ > node_pool_t;
 
+ BOOST_STATIC_ASSERT((Version <=2));
 
    /// @endcond
 
@@ -77,120 +86,358 @@
                      <const value_type>::type const_reference;
    typedef std::size_t size_type;
    typedef std::ptrdiff_t difference_type;
+ typedef detail::version_type
+ <private_adaptive_pool_base, Version> version;
+ typedef transform_iterator
+ < typename SegmentManager::
+ multiallocation_iterator
+ , detail::cast_functor <T> > multiallocation_iterator;
+ typedef typename SegmentManager::
+ multiallocation_chain multiallocation_chain;
 
    //!Obtains node_allocator from other node_allocator
    template<class T2>
    struct rebind
    {
- typedef private_adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks> other;
+ typedef private_adaptive_pool_base
+ <Version, T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
    };
 
    /// @cond
    private:
- //!Not assignable from related private_adaptive_pool
- template<class T2, class MemoryAlgorithm2, std::size_t N2, std::size_t F2>
- private_adaptive_pool& operator=
- (const private_adaptive_pool<T2, MemoryAlgorithm2, N2, F2>&);
+ //!Not assignable from related private_adaptive_pool_base
+ template<unsigned int Version2, class T2, class MemoryAlgorithm2, std::size_t N2, std::size_t F2, unsigned char OP2>
+ private_adaptive_pool_base& operator=
+ (const private_adaptive_pool_base<Version2, T2, MemoryAlgorithm2, N2, F2, OP2>&);
 
- //!Not assignable from other private_adaptive_pool
- private_adaptive_pool& operator=(const private_adaptive_pool&);
+ //!Not assignable from other private_adaptive_pool_base
+ private_adaptive_pool_base& operator=(const private_adaptive_pool_base&);
    /// @endcond
 
    public:
    //!Constructor from a segment manager
- private_adaptive_pool(segment_manager *segment_mngr)
+ private_adaptive_pool_base(segment_manager *segment_mngr)
       : m_node_pool(segment_mngr)
    {}
 
- //!Copy constructor from other private_adaptive_pool. Never throws
- private_adaptive_pool(const private_adaptive_pool &other)
+ //!Copy constructor from other private_adaptive_pool_base. Never throws
+ private_adaptive_pool_base(const private_adaptive_pool_base &other)
       : m_node_pool(other.get_segment_manager())
    {}
 
- //!Copy constructor from related private_adaptive_pool. Never throws.
+ //!Copy constructor from related private_adaptive_pool_base. Never throws.
    template<class T2>
- private_adaptive_pool
- (const private_adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks> &other)
+ private_adaptive_pool_base
+ (const private_adaptive_pool_base
+ <Version, T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other)
       : m_node_pool(other.get_segment_manager())
    {}
 
    //!Destructor, frees all used memory. Never throws
- ~private_adaptive_pool()
+ ~private_adaptive_pool_base()
    {}
 
    //!Returns the segment manager. Never throws
    segment_manager* get_segment_manager()const
    { return m_node_pool.get_segment_manager(); }
 
- //!Returns the number of elements that could be allocated. Never throws
- size_type max_size() const
- { return this->get_segment_manager()/sizeof(value_type); }
-
- //!Allocate memory for an array of count elements.
- //!Throws boost::interprocess::bad_alloc if there is no enough memory
- pointer allocate(size_type count, cvoid_pointer hint = 0)
- {
- (void)hint;
- if(count > ((size_type)-1)/sizeof(value_type))
- throw bad_alloc();
- return pointer(static_cast<value_type*>(m_node_pool.allocate(count)));
- }
-
- //!Deallocate allocated memory. Never throws
- void deallocate(const pointer &ptr, size_type count)
- { m_node_pool.deallocate(detail::get_pointer(ptr), count); }
-
- //!Deallocates all free chunks of the pool
- void deallocate_free_chunks()
- { m_node_pool.deallocate_free_chunks(); }
+ //!Returns the internal node pool. Never throws
+ node_pool_t* get_node_pool() const
+ { return const_cast<node_pool_t*>(&m_node_pool); }
 
    //!Swaps allocators. Does not throw. If each allocator is placed in a
- //!different shared memory segments, the result is undefined.*/
+ //!different shared memory segments, the result is undefined.
    friend void swap(self_t &alloc1,self_t &alloc2)
    { alloc1.m_node_pool.swap(alloc2.m_node_pool); }
 
- //These functions are obsolete. These are here to conserve
- //backwards compatibility with containers using them...
+ /// @cond
+ private:
+ node_pool_t m_node_pool;
+ /// @endcond
+};
+
+//!Equality test for same type of private_adaptive_pool_base
+template<unsigned int V, class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
+bool operator==(const private_adaptive_pool_base<V, T, S, NodesPerChunk, F, OP> &alloc1,
+ const private_adaptive_pool_base<V, T, S, NodesPerChunk, F, OP> &alloc2)
+{ return &alloc1 == &alloc2; }
+
+//!Inequality test for same type of private_adaptive_pool_base
+template<unsigned int V, class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
+bool operator!=(const private_adaptive_pool_base<V, T, S, NodesPerChunk, F, OP> &alloc1,
+ const private_adaptive_pool_base<V, T, S, NodesPerChunk, F, OP> &alloc2)
+{ return &alloc1 != &alloc2; }
+
+template < class T
+ , class SegmentManager
+ , std::size_t NodesPerChunk = 64
+ , std::size_t MaxFreeChunks = 2
+ , unsigned char OverheadPercent = 5
+ >
+class private_adaptive_pool_v1
+ : public private_adaptive_pool_base
+ < 1
+ , T
+ , SegmentManager
+ , NodesPerChunk
+ , MaxFreeChunks
+ , OverheadPercent
+ >
+{
+ public:
+ typedef detail::private_adaptive_pool_base
+ < 1, T, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> base_t;
+
+ template<class T2>
+ struct rebind
+ {
+ typedef private_adaptive_pool_v1<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ };
+
+ private_adaptive_pool_v1(SegmentManager *segment_mngr)
+ : base_t(segment_mngr)
+ {}
+
+ template<class T2>
+ private_adaptive_pool_v1
+ (const private_adaptive_pool_v1<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other)
+ : base_t(other)
+ {}
+};
+
+} //namespace detail {
+
+/// @endcond
+
+//!An STL node allocator that uses a segment manager as memory
+//!source. The internal pointer type will of the same type (raw, smart) as
+//!"typename SegmentManager::void_pointer" type. This allows
+//!placing the allocator in shared memory, memory mapped-files, etc...
+//!This allocator has its own node pool.
+//!
+//!NodesPerChunk is the minimum number of nodes of nodes allocated at once when
+//!the allocator needs runs out of nodes. MaxFreeChunks is the maximum number of totally free chunks
+//!that the adaptive node pool will hold. The rest of the totally free chunks will be
+//!deallocated with the segment manager.
+//!
+//!OverheadPercent is the (approximated) maximum size overhead (1-20%) of the allocator:
+//!(memory usable for nodes / total memory allocated from the segment manager)
+template < class T
+ , class SegmentManager
+ , std::size_t NodesPerChunk
+ , std::size_t MaxFreeChunks
+ , unsigned char OverheadPercent
+ >
+class private_adaptive_pool
+ /// @cond
+ : public detail::private_adaptive_pool_base
+ < 2
+ , T
+ , SegmentManager
+ , NodesPerChunk
+ , MaxFreeChunks
+ , OverheadPercent
+ >
+ /// @endcond
+{
+
+ #ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
+ typedef detail::private_adaptive_pool_base
+ < 2, T, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> base_t;
+ public:
+ typedef detail::version_type<private_adaptive_pool, 2> version;
+
+ template<class T2>
+ struct rebind
+ {
+ typedef private_adaptive_pool
+ <T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ };
+
+ private_adaptive_pool(SegmentManager *segment_mngr)
+ : base_t(segment_mngr)
+ {}
+
+ template<class T2>
+ private_adaptive_pool
+ (const private_adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other)
+ : base_t(other)
+ {}
+
+ #else
+ public:
+ typedef implementation_defined::segment_manager segment_manager;
+ typedef segment_manager::void_pointer void_pointer;
+ typedef implementation_defined::pointer pointer;
+ typedef implementation_defined::const_pointer const_pointer;
+ typedef T value_type;
+ typedef typename detail::add_reference
+ <value_type>::type reference;
+ typedef typename detail::add_reference
+ <const value_type>::type const_reference;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+
+ //!Obtains private_adaptive_pool from
+ //!private_adaptive_pool
+ template<class T2>
+ struct rebind
+ {
+ typedef private_adaptive_pool
+ <T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> other;
+ };
+
+ private:
+ //!Not assignable from
+ //!related private_adaptive_pool
+ template<class T2, class SegmentManager2, std::size_t N2, std::size_t F2, unsigned char OP2>
+ private_adaptive_pool& operator=
+ (const private_adaptive_pool<T2, SegmentManager2, N2, F2>&);
+
+ //!Not assignable from
+ //!other private_adaptive_pool
+ private_adaptive_pool& operator=(const private_adaptive_pool&);
+
+ public:
+ //!Constructor from a segment manager. If not present, constructs a node
+ //!pool. Increments the reference count of the associated node pool.
+ //!Can throw boost::interprocess::bad_alloc
+ private_adaptive_pool(segment_manager *segment_mngr);
+
+ //!Copy constructor from other private_adaptive_pool. Increments the reference
+ //!count of the associated node pool. Never throws
+ private_adaptive_pool(const private_adaptive_pool &other);
+
+ //!Copy constructor from related private_adaptive_pool. If not present, constructs
+ //!a node pool. Increments the reference count of the associated node pool.
+ //!Can throw boost::interprocess::bad_alloc
+ template<class T2>
+ private_adaptive_pool
+ (const private_adaptive_pool<T2, SegmentManager, NodesPerChunk, MaxFreeChunks, OverheadPercent> &other);
+
+ //!Destructor, removes node_pool_t from memory
+ //!if its reference count reaches to zero. Never throws
+ ~private_adaptive_pool();
+
+ //!Returns a pointer to the node pool.
+ //!Never throws
+ node_pool_t* get_node_pool() const;
+
+ //!Returns the segment manager.
+ //!Never throws
+ segment_manager* get_segment_manager()const;
+
+ //!Returns the number of elements that could be allocated.
+ //!Never throws
+ size_type max_size() const;
+
+ //!Allocate memory for an array of count elements.
+ //!Throws boost::interprocess::bad_alloc if there is no enough memory
+ pointer allocate(size_type count, cvoid_pointer hint = 0);
+
+ //!Deallocate allocated memory.
+ //!Never throws
+ void deallocate(const pointer &ptr, size_type count);
+
+ //!Deallocates all free chunks
+ //!of the pool
+ void deallocate_free_chunks();
+
+ //!Swaps allocators. Does not throw. If each allocator is placed in a
+ //!different memory segment, the result is undefined.
+ friend void swap(self_t &alloc1, self_t &alloc2);
 
    //!Returns address of mutable object.
    //!Never throws
- pointer address(reference value) const
- { return pointer(boost::addressof(value)); }
+ pointer address(reference value) const;
 
    //!Returns address of non mutable object.
    //!Never throws
- const_pointer address(const_reference value) const
- { return const_pointer(boost::addressof(value)); }
+ const_pointer address(const_reference value) const;
 
    //!Default construct an object.
- //!Throws if T's default constructor throws*/
- void construct(const pointer &ptr)
- { new(detail::get_pointer(ptr)) value_type; }
+ //!Throws if T's default constructor throws
+ void construct(const pointer &ptr);
 
    //!Destroys object. Throws if object's
    //!destructor throws
- void destroy(const pointer &ptr)
- { BOOST_ASSERT(ptr != 0); (*ptr).~value_type(); }
+ void destroy(const pointer &ptr);
 
- /// @cond
- private:
- priv_node_pool_t m_node_pool;
- /// @endcond
+ //!Returns maximum the number of objects the previously allocated memory
+ //!pointed by p can hold. This size only works for memory allocated with
+ //!allocate, allocation_command and allocate_many.
+ size_type size(const pointer &p) const;
+
+ std::pair<pointer, bool>
+ allocation_command(allocation_type command,
+ size_type limit_size,
+ size_type preferred_size,
+ size_type &received_size, const pointer &reuse = 0);
+
+ //!Allocates many elements of size elem_size in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. The elements must be deallocated
+ //!with deallocate(...)
+ multiallocation_iterator allocate_many(size_type elem_size, std::size_t num_elements);
+
+ //!Allocates n_elements elements, each one of size elem_sizes[i]in a
+ //!contiguous chunk
+ //!of memory. The elements must be deallocated
+ multiallocation_iterator allocate_many(const size_type *elem_sizes, size_type n_elements);
+
+ //!Allocates many elements of size elem_size in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. The elements must be deallocated
+ //!with deallocate(...)
+ void deallocate_many(multiallocation_iterator it);
+
+ //!Allocates just one object. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ //!Throws boost::interprocess::bad_alloc if there is no enough memory
+ pointer allocate_one();
+
+ //!Allocates many elements of size == 1 in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ multiallocation_iterator allocate_individual(std::size_t num_elements);
+
+ //!Deallocates memory previously allocated with allocate_one().
+ //!You should never use deallocate_one to deallocate memory allocated
+ //!with other functions different from allocate_one(). Never throws
+ void deallocate_one(const pointer &p);
+
+ //!Allocates many elements of size == 1 in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ void deallocate_individual(multiallocation_iterator it);
+ #endif
 };
 
-//!Equality test for same type of private_adaptive_pool
-template<class T, class S, std::size_t NodesPerChunk, std::size_t F> inline
-bool operator==(const private_adaptive_pool<T, S, NodesPerChunk, F> &alloc1,
- const private_adaptive_pool<T, S, NodesPerChunk, F> &alloc2)
-{ return &alloc1 == &alloc2; }
+#ifdef BOOST_INTERPROCESS_DOXYGEN_INVOKED
+
+//!Equality test for same type
+//!of private_adaptive_pool
+template<class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
+bool operator==(const private_adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc1,
+ const private_adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc2);
+
+//!Inequality test for same type
+//!of private_adaptive_pool
+template<class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
+bool operator!=(const private_adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc1,
+ const private_adaptive_pool<T, S, NodesPerChunk, F, OP> &alloc2);
 
-//!Inequality test for same type of private_adaptive_pool
-template<class T, class S, std::size_t NodesPerChunk, std::size_t F> inline
-bool operator!=(const private_adaptive_pool<T, S, NodesPerChunk, F> &alloc1,
- const private_adaptive_pool<T, S, NodesPerChunk, F> &alloc2)
-{
- return &alloc1 != &alloc2;
-}
+#endif
 
 } //namespace interprocess {
 } //namespace boost {

Modified: branches/fix-links/boost/interprocess/allocators/private_node_allocator.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/allocators/private_node_allocator.hpp (original)
+++ branches/fix-links/boost/interprocess/allocators/private_node_allocator.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,13 +1,13 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
 // See http://www.boost.org/libs/interprocess for documentation.
 //
 //////////////////////////////////////////////////////////////////////////////
-
+/*
 #ifndef BOOST_INTERPROCESS_PRIVATE_NODE_ALLOCATOR_HPP
 #define BOOST_INTERPROCESS_PRIVATE_NODE_ALLOCATOR_HPP
 
@@ -50,12 +50,8 @@
    typedef typename detail::
       pointer_to_other<void_pointer, const void>::type cvoid_pointer;
    typedef SegmentManager segment_manager;
- typedef typename detail::
- pointer_to_other<void_pointer, char>::type char_pointer;
    typedef typename detail::pointer_to_other
       <void_pointer, segment_manager>::type segment_mngr_ptr_t;
- typedef typename SegmentManager::
- mutex_family::mutex_type mutex_type;
    typedef private_node_allocator
       <T, SegmentManager, NodesPerChunk> self_t;
    typedef detail::private_node_pool
@@ -128,21 +124,30 @@
    pointer allocate(size_type count, cvoid_pointer hint = 0)
    {
       (void)hint;
- if(count > ((size_type)-1)/sizeof(value_type))
+ if(count > this->max_size())
          throw bad_alloc();
- return pointer(static_cast<value_type*>(m_node_pool.allocate(count)));
+ else if(count == 1)
+ return pointer(static_cast<value_type*>(m_node_pool.allocate_node()));
+ else
+ return pointer(static_cast<value_type*>
+ (m_node_pool.get_segment_manager()->allocate(sizeof(T)*count)));
    }
 
    //!Deallocate allocated memory. Never throws
    void deallocate(const pointer &ptr, size_type count)
- { m_node_pool.deallocate(detail::get_pointer(ptr), count); }
+ {
+ if(count == 1)
+ m_node_pool.deallocate_node(detail::get_pointer(ptr));
+ else
+ m_node_pool.get_segment_manager()->deallocate(detail::get_pointer(ptr));
+ }
 
    //!Deallocates all free chunks of the pool
    void deallocate_free_chunks()
    { m_node_pool.deallocate_free_chunks(); }
 
    //!Swaps allocators. Does not throw. If each allocator is placed in a
- //!different shared memory segments, the result is undefined.*/
+ //!different shared memory segments, the result is undefined.
    friend void swap(self_t &alloc1,self_t &alloc2)
    { alloc1.m_node_pool.swap(alloc2.m_node_pool); }
 
@@ -160,7 +165,7 @@
    { return const_pointer(boost::addressof(value)); }
 
    //!Default construct an object.
- //!Throws if T's default constructor throws*/
+ //!Throws if T's default constructor throws
    void construct(const pointer &ptr)
    { new(detail::get_pointer(ptr)) value_type; }
 
@@ -196,3 +201,432 @@
 
 #endif //#ifndef BOOST_INTERPROCESS_PRIVATE_NODE_ALLOCATOR_HPP
 
+*/
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERPROCESS_PRIVATE_NODE_ALLOCATOR_HPP
+#define BOOST_INTERPROCESS_PRIVATE_NODE_ALLOCATOR_HPP
+
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+
+#include <boost/interprocess/interprocess_fwd.hpp>
+#include <boost/assert.hpp>
+#include <boost/utility/addressof.hpp>
+#include <boost/interprocess/allocators/detail/node_pool.hpp>
+#include <boost/interprocess/exceptions.hpp>
+#include <boost/interprocess/detail/utilities.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
+#include <memory>
+#include <algorithm>
+#include <cstddef>
+
+//!\file
+//!Describes private_node_allocator_base pooled shared memory STL compatible allocator
+
+namespace boost {
+namespace interprocess {
+
+/// @cond
+
+namespace detail {
+
+template < unsigned int Version
+ , class T
+ , class SegmentManager
+ , std::size_t NodesPerChunk
+ >
+class private_node_allocator_base
+ : public node_pool_allocation_impl
+ < private_node_allocator_base < Version, T, SegmentManager, NodesPerChunk>
+ , Version
+ , T
+ , SegmentManager
+ >
+{
+ /// @cond
+ private:
+ typedef typename SegmentManager::void_pointer void_pointer;
+ typedef SegmentManager segment_manager;
+ typedef private_node_allocator_base
+ < Version, T, SegmentManager, NodesPerChunk> self_t;
+ typedef detail::private_node_pool
+ <SegmentManager
+ , sizeof(T)
+ , NodesPerChunk
+ > node_pool_t;
+
+ BOOST_STATIC_ASSERT((Version <=2));
+
+ /// @endcond
+
+ public:
+ typedef typename detail::
+ pointer_to_other<void_pointer, T>::type pointer;
+ typedef typename detail::
+ pointer_to_other<void_pointer, const T>::type const_pointer;
+ typedef T value_type;
+ typedef typename detail::add_reference
+ <value_type>::type reference;
+ typedef typename detail::add_reference
+ <const value_type>::type const_reference;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef detail::version_type
+ <private_node_allocator_base, Version> version;
+ typedef transform_iterator
+ < typename SegmentManager::
+ multiallocation_iterator
+ , detail::cast_functor <T> > multiallocation_iterator;
+ typedef typename SegmentManager::
+ multiallocation_chain multiallocation_chain;
+
+ //!Obtains node_allocator from other node_allocator
+ template<class T2>
+ struct rebind
+ {
+ typedef private_node_allocator_base
+ <Version, T2, SegmentManager, NodesPerChunk> other;
+ };
+
+ /// @cond
+ private:
+ //!Not assignable from related private_node_allocator_base
+ template<unsigned int Version2, class T2, class MemoryAlgorithm2, std::size_t N2>
+ private_node_allocator_base& operator=
+ (const private_node_allocator_base<Version2, T2, MemoryAlgorithm2, N2>&);
+
+ //!Not assignable from other private_node_allocator_base
+ private_node_allocator_base& operator=(const private_node_allocator_base&);
+ /// @endcond
+
+ public:
+ //!Constructor from a segment manager
+ private_node_allocator_base(segment_manager *segment_mngr)
+ : m_node_pool(segment_mngr)
+ {}
+
+ //!Copy constructor from other private_node_allocator_base. Never throws
+ private_node_allocator_base(const private_node_allocator_base &other)
+ : m_node_pool(other.get_segment_manager())
+ {}
+
+ //!Copy constructor from related private_node_allocator_base. Never throws.
+ template<class T2>
+ private_node_allocator_base
+ (const private_node_allocator_base
+ <Version, T2, SegmentManager, NodesPerChunk> &other)
+ : m_node_pool(other.get_segment_manager())
+ {}
+
+ //!Destructor, frees all used memory. Never throws
+ ~private_node_allocator_base()
+ {}
+
+ //!Returns the segment manager. Never throws
+ segment_manager* get_segment_manager()const
+ { return m_node_pool.get_segment_manager(); }
+
+ //!Returns the internal node pool. Never throws
+ node_pool_t* get_node_pool() const
+ { return const_cast<node_pool_t*>(&m_node_pool); }
+
+ //!Swaps allocators. Does not throw. If each allocator is placed in a
+ //!different shared memory segments, the result is undefined.
+ friend void swap(self_t &alloc1,self_t &alloc2)
+ { alloc1.m_node_pool.swap(alloc2.m_node_pool); }
+
+ /// @cond
+ private:
+ node_pool_t m_node_pool;
+ /// @endcond
+};
+
+//!Equality test for same type of private_node_allocator_base
+template<unsigned int V, class T, class S, std::size_t NodesPerChunk> inline
+bool operator==(const private_node_allocator_base<V, T, S, NodesPerChunk> &alloc1,
+ const private_node_allocator_base<V, T, S, NodesPerChunk> &alloc2)
+{ return &alloc1 == &alloc2; }
+
+//!Inequality test for same type of private_node_allocator_base
+template<unsigned int V, class T, class S, std::size_t NodesPerChunk> inline
+bool operator!=(const private_node_allocator_base<V, T, S, NodesPerChunk> &alloc1,
+ const private_node_allocator_base<V, T, S, NodesPerChunk> &alloc2)
+{ return &alloc1 != &alloc2; }
+
+template < class T
+ , class SegmentManager
+ , std::size_t NodesPerChunk = 64
+ >
+class private_node_allocator_v1
+ : public private_node_allocator_base
+ < 1
+ , T
+ , SegmentManager
+ , NodesPerChunk
+ >
+{
+ public:
+ typedef detail::private_node_allocator_base
+ < 1, T, SegmentManager, NodesPerChunk> base_t;
+
+ template<class T2>
+ struct rebind
+ {
+ typedef private_node_allocator_v1<T2, SegmentManager, NodesPerChunk> other;
+ };
+
+ private_node_allocator_v1(SegmentManager *segment_mngr)
+ : base_t(segment_mngr)
+ {}
+
+ template<class T2>
+ private_node_allocator_v1
+ (const private_node_allocator_v1<T2, SegmentManager, NodesPerChunk> &other)
+ : base_t(other)
+ {}
+};
+
+} //namespace detail {
+
+/// @endcond
+
+//!An STL node allocator that uses a segment manager as memory
+//!source. The internal pointer type will of the same type (raw, smart) as
+//!"typename SegmentManager::void_pointer" type. This allows
+//!placing the allocator in shared memory, memory mapped-files, etc...
+//!This allocator has its own node pool. NodesPerChunk is the number of nodes allocated
+//!at once when the allocator needs runs out of nodes
+template < class T
+ , class SegmentManager
+ , std::size_t NodesPerChunk
+ >
+class private_node_allocator
+ /// @cond
+ : public detail::private_node_allocator_base
+ < 2
+ , T
+ , SegmentManager
+ , NodesPerChunk
+ >
+ /// @endcond
+{
+
+ #ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
+ typedef detail::private_node_allocator_base
+ < 2, T, SegmentManager, NodesPerChunk> base_t;
+ public:
+ typedef detail::version_type<private_node_allocator, 2> version;
+
+ template<class T2>
+ struct rebind
+ {
+ typedef private_node_allocator
+ <T2, SegmentManager, NodesPerChunk> other;
+ };
+
+ private_node_allocator(SegmentManager *segment_mngr)
+ : base_t(segment_mngr)
+ {}
+
+ template<class T2>
+ private_node_allocator
+ (const private_node_allocator<T2, SegmentManager, NodesPerChunk> &other)
+ : base_t(other)
+ {}
+
+ #else
+ public:
+ typedef implementation_defined::segment_manager segment_manager;
+ typedef segment_manager::void_pointer void_pointer;
+ typedef implementation_defined::pointer pointer;
+ typedef implementation_defined::const_pointer const_pointer;
+ typedef T value_type;
+ typedef typename detail::add_reference
+ <value_type>::type reference;
+ typedef typename detail::add_reference
+ <const value_type>::type const_reference;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+
+ //!Obtains private_node_allocator from
+ //!private_node_allocator
+ template<class T2>
+ struct rebind
+ {
+ typedef private_node_allocator
+ <T2, SegmentManager, NodesPerChunk> other;
+ };
+
+ private:
+ //!Not assignable from
+ //!related private_node_allocator
+ template<class T2, class SegmentManager2, std::size_t N2>
+ private_node_allocator& operator=
+ (const private_node_allocator<T2, SegmentManager2, N2>&);
+
+ //!Not assignable from
+ //!other private_node_allocator
+ private_node_allocator& operator=(const private_node_allocator&);
+
+ public:
+ //!Constructor from a segment manager. If not present, constructs a node
+ //!pool. Increments the reference count of the associated node pool.
+ //!Can throw boost::interprocess::bad_alloc
+ private_node_allocator(segment_manager *segment_mngr);
+
+ //!Copy constructor from other private_node_allocator. Increments the reference
+ //!count of the associated node pool. Never throws
+ private_node_allocator(const private_node_allocator &other);
+
+ //!Copy constructor from related private_node_allocator. If not present, constructs
+ //!a node pool. Increments the reference count of the associated node pool.
+ //!Can throw boost::interprocess::bad_alloc
+ template<class T2>
+ private_node_allocator
+ (const private_node_allocator<T2, SegmentManager, NodesPerChunk> &other);
+
+ //!Destructor, removes node_pool_t from memory
+ //!if its reference count reaches to zero. Never throws
+ ~private_node_allocator();
+
+ //!Returns a pointer to the node pool.
+ //!Never throws
+ node_pool_t* get_node_pool() const;
+
+ //!Returns the segment manager.
+ //!Never throws
+ segment_manager* get_segment_manager()const;
+
+ //!Returns the number of elements that could be allocated.
+ //!Never throws
+ size_type max_size() const;
+
+ //!Allocate memory for an array of count elements.
+ //!Throws boost::interprocess::bad_alloc if there is no enough memory
+ pointer allocate(size_type count, cvoid_pointer hint = 0);
+
+ //!Deallocate allocated memory.
+ //!Never throws
+ void deallocate(const pointer &ptr, size_type count);
+
+ //!Deallocates all free chunks
+ //!of the pool
+ void deallocate_free_chunks();
+
+ //!Swaps allocators. Does not throw. If each allocator is placed in a
+ //!different memory segment, the result is undefined.
+ friend void swap(self_t &alloc1, self_t &alloc2);
+
+ //!Returns address of mutable object.
+ //!Never throws
+ pointer address(reference value) const;
+
+ //!Returns address of non mutable object.
+ //!Never throws
+ const_pointer address(const_reference value) const;
+
+ //!Default construct an object.
+ //!Throws if T's default constructor throws
+ void construct(const pointer &ptr);
+
+ //!Destroys object. Throws if object's
+ //!destructor throws
+ void destroy(const pointer &ptr);
+
+ //!Returns maximum the number of objects the previously allocated memory
+ //!pointed by p can hold. This size only works for memory allocated with
+ //!allocate, allocation_command and allocate_many.
+ size_type size(const pointer &p) const;
+
+ std::pair<pointer, bool>
+ allocation_command(allocation_type command,
+ size_type limit_size,
+ size_type preferred_size,
+ size_type &received_size, const pointer &reuse = 0);
+
+ //!Allocates many elements of size elem_size in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. The elements must be deallocated
+ //!with deallocate(...)
+ multiallocation_iterator allocate_many(size_type elem_size, std::size_t num_elements);
+
+ //!Allocates n_elements elements, each one of size elem_sizes[i]in a
+ //!contiguous chunk
+ //!of memory. The elements must be deallocated
+ multiallocation_iterator allocate_many(const size_type *elem_sizes, size_type n_elements);
+
+ //!Allocates many elements of size elem_size in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. The elements must be deallocated
+ //!with deallocate(...)
+ void deallocate_many(multiallocation_iterator it);
+
+ //!Allocates just one object. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ //!Throws boost::interprocess::bad_alloc if there is no enough memory
+ pointer allocate_one();
+
+ //!Allocates many elements of size == 1 in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ multiallocation_iterator allocate_individual(std::size_t num_elements);
+
+ //!Deallocates memory previously allocated with allocate_one().
+ //!You should never use deallocate_one to deallocate memory allocated
+ //!with other functions different from allocate_one(). Never throws
+ void deallocate_one(const pointer &p);
+
+ //!Allocates many elements of size == 1 in a contiguous chunk
+ //!of memory. The minimum number to be allocated is min_elements,
+ //!the preferred and maximum number is
+ //!preferred_elements. The number of actually allocated elements is
+ //!will be assigned to received_size. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ void deallocate_individual(multiallocation_iterator it);
+ #endif
+};
+
+#ifdef BOOST_INTERPROCESS_DOXYGEN_INVOKED
+
+//!Equality test for same type
+//!of private_node_allocator
+template<class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
+bool operator==(const private_node_allocator<T, S, NodesPerChunk, F, OP> &alloc1,
+ const private_node_allocator<T, S, NodesPerChunk, F, OP> &alloc2);
+
+//!Inequality test for same type
+//!of private_node_allocator
+template<class T, class S, std::size_t NodesPerChunk, std::size_t F, unsigned char OP> inline
+bool operator!=(const private_node_allocator<T, S, NodesPerChunk, F, OP> &alloc1,
+ const private_node_allocator<T, S, NodesPerChunk, F, OP> &alloc2);
+
+#endif
+
+} //namespace interprocess {
+} //namespace boost {
+
+#include <boost/interprocess/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_INTERPROCESS_PRIVATE_NODE_ALLOCATOR_HPP
+

Modified: branches/fix-links/boost/interprocess/containers/detail/flat_tree.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/containers/detail/flat_tree.hpp (original)
+++ branches/fix-links/boost/interprocess/containers/detail/flat_tree.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/containers/detail/node_alloc_holder.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/containers/detail/node_alloc_holder.hpp (original)
+++ branches/fix-links/boost/interprocess/containers/detail/node_alloc_holder.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -74,6 +74,9 @@
    typedef detail::integral_constant<unsigned,
       boost::interprocess::detail::
          version<NodeAlloc>::value> alloc_version;
+ typedef typename ICont::iterator icont_iterator;
+ typedef typename ICont::const_iterator icont_citerator;
+ typedef allocator_destroyer<NodeAlloc> Destroyer;
 
    node_alloc_holder(const ValAlloc &a)
       : members_(a)
@@ -292,18 +295,41 @@
          if(constructed){
             this->destroy(p);
          }
- this->deallocate_one(p);
- multiallocation_iterator itend;
- while(itbeg != itend){
- Node *n = &*itbeg;
- ++itbeg;
- this->deallocate_one(n);
- }
+ this->node_alloc().deallocate_many(itbeg);
       }
       BOOST_CATCH_END
       return beg;
    }
 
+ void clear(allocator_v1)
+ { this->icont().clear_and_dispose(Destroyer(this->node_alloc())); }
+
+ void clear(allocator_v2)
+ {
+ allocator_multialloc_chain_node_deallocator<NodeAlloc> chain_holder(this->node_alloc());
+ this->icont().clear_and_dispose(chain_holder.get_chain_builder());
+ }
+
+ icont_iterator erase_range(icont_iterator first, icont_iterator last, allocator_v1)
+ { return this->icont().erase_and_dispose(first, last, Destroyer(this->node_alloc())); }
+
+ icont_iterator erase_range(icont_iterator first, icont_iterator last, allocator_v2)
+ {
+ allocator_multialloc_chain_node_deallocator<NodeAlloc> chain_holder(this->node_alloc());
+ return this->icont().erase_and_dispose(first, last, chain_holder.get_chain_builder());
+ }
+
+ template<class Key, class Comparator>
+ size_type erase_key(const Key& k, const Comparator &comp, allocator_v1)
+ { return this->icont().erase_and_dispose(k, comp, Destroyer(this->node_alloc())); }
+
+ template<class Key, class Comparator>
+ size_type erase_key(const Key& k, const Comparator &comp, allocator_v2)
+ {
+ allocator_multialloc_chain_node_deallocator<NodeAlloc> chain_holder(this->node_alloc());
+ return this->icont().erase_and_dispose(k, comp, chain_holder.get_chain_builder());
+ }
+
    protected:
    struct cloner
    {
@@ -359,10 +385,10 @@
    { return this->members_.m_icont; }
 
    NodeAlloc &node_alloc()
- { return this->members_; }
+ { return static_cast<NodeAlloc &>(this->members_); }
 
    const NodeAlloc &node_alloc() const
- { return this->members_; }
+ { return static_cast<const NodeAlloc &>(this->members_); }
 };
 
 } //namespace detail {

Modified: branches/fix-links/boost/interprocess/containers/detail/tree.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/containers/detail/tree.hpp (original)
+++ branches/fix-links/boost/interprocess/containers/detail/tree.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -732,13 +732,13 @@
    { return iterator(this->icont().erase_and_dispose(position.get(), Destroyer(this->node_alloc()))); }
 
    size_type erase(const key_type& k)
- { return this->icont().erase_and_dispose(k, KeyNodeCompare(value_comp()), Destroyer(this->node_alloc())); }
+ { return AllocHolder::erase_key(k, KeyNodeCompare(value_comp()), alloc_version()); }
 
    iterator erase(const_iterator first, const_iterator last)
- { return iterator(this->icont().erase_and_dispose(first.get(), last.get(), Destroyer(this->node_alloc()))); }
+ { return iterator(AllocHolder::erase_range(first.get(), last.get(), alloc_version())); }
 
    void clear()
- { this->icont().clear_and_dispose(Destroyer(this->node_alloc())); }
+ { AllocHolder::clear(alloc_version()); }
 
    // set operations:
    iterator find(const key_type& k)

Modified: branches/fix-links/boost/interprocess/containers/flat_map.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/containers/flat_map.hpp (original)
+++ branches/fix-links/boost/interprocess/containers/flat_map.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/containers/flat_set.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/containers/flat_set.hpp (original)
+++ branches/fix-links/boost/interprocess/containers/flat_set.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/containers/list.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/containers/list.hpp (original)
+++ branches/fix-links/boost/interprocess/containers/list.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -404,7 +404,7 @@
    //!
    //! <b>Complexity</b>: Linear to the number of elements in the list.
    void clear()
- { this->icont().clear_and_dispose(Destroyer(this->node_alloc())); }
+ { AllocHolder::clear(alloc_version()); }
 
    //! <b>Effects</b>: Returns an iterator to the first element contained in the list.
    //!
@@ -786,7 +786,7 @@
    //!
    //! <b>Complexity</b>: Linear to the distance between first and last.
    iterator erase(iterator first, iterator last)
- { return iterator(this->icont().erase_and_dispose(first.get(), last.get(), Destroyer(this->node_alloc()))); }
+ { return iterator(AllocHolder::erase_range(first.get(), last.get(), alloc_version())); }
 
    //! <b>Effects</b>: Assigns the n copies of val to *this.
    //!
@@ -1085,6 +1085,7 @@
 
    /// @cond
    private:
+
    //Iterator range version
    template<class InpIterator>
    void priv_create_and_insert_nodes
@@ -1160,7 +1161,7 @@
 
    template<class Integer>
    void priv_insert_dispatch(iterator p, Integer n, Integer x, detail::true_)
- { this->priv_create_and_insert_nodes(p, n, x); }
+ { this->insert(p, (size_type)n, x); }
 
    void priv_fill_assign(size_type n, const T& val)
    {

Modified: branches/fix-links/boost/interprocess/containers/map.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/containers/map.hpp (original)
+++ branches/fix-links/boost/interprocess/containers/map.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/containers/set.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/containers/set.hpp (original)
+++ branches/fix-links/boost/interprocess/containers/set.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/containers/slist.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/containers/slist.hpp (original)
+++ branches/fix-links/boost/interprocess/containers/slist.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2004-2008. 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)
 //
@@ -8,7 +8,7 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 //
-// This file comes from SGI's stl_slist.h file. Modified by Ion Gaztanaga 2004-2007
+// This file comes from SGI's stl_slist.h file. Modified by Ion Gaztanaga 2004-2008
 // Renaming, isolating and porting to generic algorithms. Pointer typedef
 // set to allocator::pointer to allow placing it in shared memory.
 //

Modified: branches/fix-links/boost/interprocess/containers/string.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/containers/string.hpp (original)
+++ branches/fix-links/boost/interprocess/containers/string.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -8,7 +8,7 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 //
-// This file comes from SGI's string file. Modified by Ion Gaztanaga 2004-2007
+// This file comes from SGI's string file. Modified by Ion Gaztanaga 2004-2008
 // Renaming, isolating and porting to generic algorithms. Pointer typedef
 // set to allocator::pointer to allow placing it in shared memory.
 //

Modified: branches/fix-links/boost/interprocess/containers/vector.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/containers/vector.hpp (original)
+++ branches/fix-links/boost/interprocess/containers/vector.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -740,6 +740,9 @@
          //Check for forward expansion
          same_buffer_start = ret.second && this->members_.m_start == ret.first;
          if(same_buffer_start){
+ #ifdef BOOST_INTERPROCESS_VECTOR_ALLOC_STATS
+ ++this->num_expand_fwd;
+ #endif
             this->members_.m_capacity = real_cap;
          }
          //If there is no forward expansion, move objects
@@ -748,6 +751,9 @@
             copy_move_it dummy_it(detail::get_pointer(this->members_.m_start));
             //Backwards (and possibly forward) expansion
             if(ret.second){
+ #ifdef BOOST_INTERPROCESS_VECTOR_ALLOC_STATS
+ ++this->num_expand_bwd;
+ #endif
                this->priv_range_insert_expand_backwards
                   ( detail::get_pointer(ret.first)
                   , real_cap
@@ -758,6 +764,9 @@
             }
             //New buffer
             else{
+ #ifdef BOOST_INTERPROCESS_VECTOR_ALLOC_STATS
+ ++this->num_alloc;
+ #endif
                this->priv_range_insert_new_allocation
                   ( detail::get_pointer(ret.first)
                   , real_cap
@@ -1184,11 +1193,17 @@
          
          //If we had room or we have expanded forward
          if (same_buffer_start){
+ #ifdef BOOST_INTERPROCESS_VECTOR_ALLOC_STATS
+ ++this->num_expand_fwd;
+ #endif
             this->priv_range_insert_expand_forward
                (detail::get_pointer(pos), first, last, n);
          }
          //Backwards (and possibly forward) expansion
          else if(ret.second){
+ #ifdef BOOST_INTERPROCESS_VECTOR_ALLOC_STATS
+ ++this->num_expand_bwd;
+ #endif
             this->priv_range_insert_expand_backwards
                ( detail::get_pointer(ret.first)
                , real_cap
@@ -1199,6 +1214,9 @@
          }
          //New buffer
          else{
+ #ifdef BOOST_INTERPROCESS_VECTOR_ALLOC_STATS
+ ++this->num_alloc;
+ #endif
             this->priv_range_insert_new_allocation
                ( detail::get_pointer(ret.first)
                , real_cap
@@ -1778,6 +1796,15 @@
       if (n >= size())
          throw std::out_of_range("vector::at");
    }
+
+ #ifdef BOOST_INTERPROCESS_VECTOR_ALLOC_STATS
+ public:
+ unsigned int num_expand_fwd;
+ unsigned int num_expand_bwd;
+ unsigned int num_alloc;
+ void reset_alloc_stats()
+ { num_expand_fwd = num_expand_bwd = num_alloc = 0; }
+ #endif
    /// @endcond
 };
 

Modified: branches/fix-links/boost/interprocess/creation_tags.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/creation_tags.hpp (original)
+++ branches/fix-links/boost/interprocess/creation_tags.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/detail/algorithms.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/algorithms.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/algorithms.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007.
+// (C) Copyright Ion Gaztanaga 2005-2008.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/fix-links/boost/interprocess/detail/atomic.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/atomic.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/atomic.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2007
+// (C) Copyright Ion Gaztanaga 2006-2008
 // (C) Copyright Markus Schoepflin 2007
 //
 // Distributed under the Boost Software License, Version 1.0. (See

Modified: branches/fix-links/boost/interprocess/detail/cast_tags.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/cast_tags.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/cast_tags.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/detail/config_begin.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/config_begin.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/config_begin.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -9,6 +9,7 @@
    #define _CRT_SECURE_NO_DEPRECATE
    #endif
    #pragma warning (push)
+ #pragma warning (disable : 4702) // unreachable code
    #pragma warning (disable : 4706) // assignment within conditional expression
    #pragma warning (disable : 4127) // conditional expression is constant
    #pragma warning (disable : 4146) // unary minus operator applied to unsigned type, result still unsigned

Modified: branches/fix-links/boost/interprocess/detail/in_place_interface.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/in_place_interface.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/in_place_interface.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/detail/interprocess_tester.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/interprocess_tester.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/interprocess_tester.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2007-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/detail/iterators.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/iterators.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/iterators.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007.
+// (C) Copyright Ion Gaztanaga 2005-2008.
 // (C) Copyright Gennaro Prota 2003 - 2004.
 //
 // Distributed under the Boost Software License, Version 1.0.
@@ -428,6 +428,12 @@
       operator->() const
    { return operator_arrow_proxy<typename UnaryFunction::result_type>(dereference()); }
 
+ Iterator & base()
+ { return m_it; }
+
+ const Iterator & base() const
+ { return m_it; }
+
    private:
    Iterator m_it;
 

Modified: branches/fix-links/boost/interprocess/detail/managed_memory_impl.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/managed_memory_impl.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/managed_memory_impl.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/detail/math_functions.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/math_functions.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/math_functions.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,7 +1,7 @@
 //////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Stephen Cleary 2000.
-// (C) Copyright Ion Gaztanaga 2007.
+// (C) Copyright Ion Gaztanaga 2007-2008.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/fix-links/boost/interprocess/detail/min_max.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/min_max.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/min_max.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007.
+// (C) Copyright Ion Gaztanaga 2005-2008.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/fix-links/boost/interprocess/detail/mpl.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/mpl.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/mpl.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007.
+// (C) Copyright Ion Gaztanaga 2005-2008.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/fix-links/boost/interprocess/detail/named_proxy.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/named_proxy.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/named_proxy.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/detail/os_file_functions.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/os_file_functions.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/os_file_functions.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/detail/os_thread_functions.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/os_thread_functions.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/os_thread_functions.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/detail/pointer_type.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/pointer_type.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/pointer_type.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007.
+// (C) Copyright Ion Gaztanaga 2005-2008.
 // (C) Copyright Gennaro Prota 2003 - 2004.
 //
 // Distributed under the Boost Software License, Version 1.0.

Modified: branches/fix-links/boost/interprocess/detail/posix_time_types_wrk.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/posix_time_types_wrk.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/posix_time_types_wrk.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/detail/segment_manager_helper.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/segment_manager_helper.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/segment_manager_helper.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/detail/tmp_dir_helpers.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/tmp_dir_helpers.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/tmp_dir_helpers.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2007-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/detail/type_traits.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/type_traits.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/type_traits.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 // (C) Copyright John Maddock 2000.
-// (C) Copyright Ion Gaztanaga 2005-2007.
+// (C) Copyright Ion Gaztanaga 2005-2008.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/fix-links/boost/interprocess/detail/utilities.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/utilities.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/utilities.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007.
+// (C) Copyright Ion Gaztanaga 2005-2008.
 // (C) Copyright Gennaro Prota 2003 - 2004.
 //
 // Distributed under the Boost Software License, Version 1.0.
@@ -25,6 +25,9 @@
 #include <boost/interprocess/detail/move.hpp>
 #include <boost/type_traits/has_trivial_destructor.hpp>
 #include <boost/interprocess/detail/min_max.hpp>
+#include <boost/interprocess/detail/type_traits.hpp>
+#include <boost/interprocess/detail/type_traits.hpp>
+#include <boost/interprocess/detail/version_type.hpp>
 #include <utility>
 #include <algorithm>
 
@@ -70,14 +73,27 @@
 struct scoped_ptr_dealloc_functor
 {
    typedef typename Allocator::pointer pointer;
+ typedef detail::integral_constant<unsigned,
+ boost::interprocess::detail::
+ version<Allocator>::value> alloc_version;
+ typedef detail::integral_constant<unsigned, 1> allocator_v1;
+ typedef detail::integral_constant<unsigned, 2> allocator_v2;
 
+ private:
+ void priv_deallocate(const typename Allocator::pointer &p, allocator_v1)
+ { m_alloc.deallocate(p, 1); }
+
+ void priv_deallocate(const typename Allocator::pointer &p, allocator_v2)
+ { m_alloc.deallocate_one(p); }
+
+ public:
    Allocator& m_alloc;
 
    scoped_ptr_dealloc_functor(Allocator& a)
- : m_alloc(a) {}
+ : m_alloc(a) {}
 
    void operator()(pointer ptr)
- { if (ptr) m_alloc.deallocate(ptr, 1); }
+ { if (ptr) priv_deallocate(ptr, alloc_version()); }
 };
 
 //!A deleter for scoped_ptr that deallocates the memory
@@ -86,7 +102,20 @@
 struct scoped_deallocator
 {
    typedef typename Allocator::pointer pointer;
+ typedef detail::integral_constant<unsigned,
+ boost::interprocess::detail::
+ version<Allocator>::value> alloc_version;
+ typedef detail::integral_constant<unsigned, 1> allocator_v1;
+ typedef detail::integral_constant<unsigned, 2> allocator_v2;
 
+ private:
+ void priv_deallocate(allocator_v1)
+ { m_alloc.deallocate(m_ptr, 1); }
+
+ void priv_deallocate(allocator_v2)
+ { m_alloc.deallocate_one(m_ptr); }
+
+ public:
    pointer m_ptr;
    Allocator& m_alloc;
 
@@ -94,7 +123,7 @@
       : m_ptr(p), m_alloc(a) {}
 
    ~scoped_deallocator()
- { if (m_ptr) m_alloc.deallocate(m_ptr, 1); }
+ { if (m_ptr)priv_deallocate(alloc_version()); }
 
    void release()
    { m_ptr = 0; }
@@ -189,9 +218,22 @@
 class allocator_destroyer
 {
    typedef typename A::value_type value_type;
+ typedef detail::integral_constant<unsigned,
+ boost::interprocess::detail::
+ version<A>::value> alloc_version;
+ typedef detail::integral_constant<unsigned, 1> allocator_v1;
+ typedef detail::integral_constant<unsigned, 2> allocator_v2;
+
    private:
    A & a_;
 
+ private:
+ void priv_deallocate(const typename A::pointer &p, allocator_v1)
+ { a_.deallocate(p, 1); }
+
+ void priv_deallocate(const typename A::pointer &p, allocator_v2)
+ { a_.deallocate_one(p); }
+
    public:
    allocator_destroyer(A &a)
       : a_(a)
@@ -200,35 +242,86 @@
    void operator()(const typename A::pointer &p)
    {
       detail::get_pointer(p)->~value_type();
- a_.deallocate(p, 1);
+ priv_deallocate(p, alloc_version());
    }
 };
 
-//!A class used for exception-safe multi-allocation + construction.
-template <class Allocator>
-struct multiallocation_deallocator
+template <class A>
+class allocator_destroyer_and_chain_builder
 {
- typedef typename Allocator::multiallocation_iterator multiallocation_iterator;
+ typedef typename A::value_type value_type;
+ typedef typename A::multiallocation_iterator multiallocation_iterator;
+ typedef typename A::multiallocation_chain multiallocation_chain;
 
- multiallocation_iterator m_itbeg;
- Allocator& m_alloc;
+ A & a_;
+ multiallocation_chain &c_;
 
- multiallocation_deallocator(multiallocation_iterator itbeg, Allocator& a)
- : m_itbeg(itbeg), m_alloc(a) {}
+ public:
+ allocator_destroyer_and_chain_builder(A &a, multiallocation_chain &c)
+ : a_(a), c_(c)
+ {}
 
- ~multiallocation_deallocator()
+ void operator()(const typename A::pointer &p)
+ {
+ value_type *vp = detail::get_pointer(p);
+ vp->~value_type();
+ c_.push_back(vp);
+ }
+};
+
+template <class A>
+class allocator_multialloc_chain_node_deallocator
+{
+ typedef typename A::value_type value_type;
+ typedef typename A::multiallocation_iterator multiallocation_iterator;
+ typedef typename A::multiallocation_chain multiallocation_chain;
+ typedef allocator_destroyer_and_chain_builder<A> chain_builder;
+
+ A & a_;
+ multiallocation_chain c_;
+
+ public:
+ allocator_multialloc_chain_node_deallocator(A &a)
+ : a_(a), c_()
+ {}
+
+ chain_builder get_chain_builder()
+ { return chain_builder(a_, c_); }
+
+ ~allocator_multialloc_chain_node_deallocator()
    {
- multiallocation_iterator endit;
- while(m_itbeg != endit){
- m_alloc.deallocate(&*m_itbeg, 1);
- ++m_itbeg;
- }
+ multiallocation_iterator it(c_.get_it());
+ if(it != multiallocation_iterator())
+ a_.deallocate_individual(it);
    }
-
- void increment()
- { ++m_itbeg; }
 };
 
+template <class A>
+class allocator_multialloc_chain_array_deallocator
+{
+ typedef typename A::value_type value_type;
+ typedef typename A::multiallocation_iterator multiallocation_iterator;
+ typedef typename A::multiallocation_chain multiallocation_chain;
+ typedef allocator_destroyer_and_chain_builder<A> chain_builder;
+
+ A & a_;
+ multiallocation_chain c_;
+
+ public:
+ allocator_multialloc_chain_array_deallocator(A &a)
+ : a_(a), c_()
+ {}
+
+ chain_builder get_chain_builder()
+ { return chain_builder(a_, c_); }
+
+ ~allocator_multialloc_chain_array_deallocator()
+ {
+ multiallocation_iterator it(c_.get_it());
+ if(it != multiallocation_iterator())
+ a_.deallocate_many(it);
+ }
+};
 
 //!A class used for exception-safe multi-allocation + construction.
 template <class Allocator>
@@ -577,6 +670,14 @@
 }
 #endif
 
+template<class T>
+struct cast_functor
+{
+ typedef typename detail::add_reference<T>::type result_type;
+ result_type operator()(char &ptr) const
+ { return *static_cast<T*>(static_cast<void*>(&ptr)); }
+};
+
 } //namespace detail {
 
 //!The pair is movable if any of its members is movable

Modified: branches/fix-links/boost/interprocess/detail/version_type.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/version_type.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/version_type.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/detail/win32_api.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/win32_api.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/win32_api.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/detail/workaround.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/detail/workaround.hpp (original)
+++ branches/fix-links/boost/interprocess/detail/workaround.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -19,8 +19,8 @@
 
    #if defined(_POSIX_THREAD_PROCESS_SHARED)
    # if !((_XOPEN_VERSION >= 600) && (_POSIX_THREAD_PROCESS_SHARED - 0 <= 0))
- // Cygwin defines _POSIX_THREAD_PROCESS_SHARED but does not support it.
- // Mac Os X >= Leopard defines _POSIX_THREAD_PROCESS_SHARED but it does not seem to work
+ //Cygwin defines _POSIX_THREAD_PROCESS_SHARED but does not implement it.
+ //Mac Os X >= Leopard defines _POSIX_THREAD_PROCESS_SHARED but does not seems to work.
    # if !defined(__CYGWIN__) && !defined(__APPLE__)
    # define BOOST_INTERPROCESS_POSIX_PROCESS_SHARED
    # endif

Modified: branches/fix-links/boost/interprocess/errors.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/errors.hpp (original)
+++ branches/fix-links/boost/interprocess/errors.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/exceptions.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/exceptions.hpp (original)
+++ branches/fix-links/boost/interprocess/exceptions.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/file_mapping.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/file_mapping.hpp (original)
+++ branches/fix-links/boost/interprocess/file_mapping.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/indexes/flat_map_index.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/indexes/flat_map_index.hpp (original)
+++ branches/fix-links/boost/interprocess/indexes/flat_map_index.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/indexes/iset_index.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/indexes/iset_index.hpp (original)
+++ branches/fix-links/boost/interprocess/indexes/iset_index.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/indexes/iunordered_set_index.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/indexes/iunordered_set_index.hpp (original)
+++ branches/fix-links/boost/interprocess/indexes/iunordered_set_index.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/indexes/map_index.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/indexes/map_index.hpp (original)
+++ branches/fix-links/boost/interprocess/indexes/map_index.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/indexes/null_index.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/indexes/null_index.hpp (original)
+++ branches/fix-links/boost/interprocess/indexes/null_index.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/indexes/unordered_map_index.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/indexes/unordered_map_index.hpp (original)
+++ branches/fix-links/boost/interprocess/indexes/unordered_map_index.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/interprocess_fwd.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/interprocess_fwd.hpp (original)
+++ branches/fix-links/boost/interprocess/interprocess_fwd.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -129,13 +129,19 @@
 template<class T, class SegmentManager, std::size_t NodesPerChunk = 64>
 class cached_node_allocator;
 
-template<class T, class SegmentManager, std::size_t NodesPerChunk = 64, std::size_t MaxFreeChunks = 2>
+template<class T, class SegmentManager, std::size_t NodesPerChunk = 64, std::size_t MaxFreeChunks = 2
+ , unsigned char OverheadPercent = 5
+>
 class adaptive_pool;
 
-template<class T, class SegmentManager, std::size_t NodesPerChunk = 64, std::size_t MaxFreeChunks = 2>
+template<class T, class SegmentManager, std::size_t NodesPerChunk = 64, std::size_t MaxFreeChunks = 2
+ , unsigned char OverheadPercent = 5
+>
 class private_adaptive_pool;
 
-template<class T, class SegmentManager, std::size_t NodesPerChunk = 64, std::size_t MaxFreeChunks = 2>
+template<class T, class SegmentManager, std::size_t NodesPerChunk = 64, std::size_t MaxFreeChunks = 2
+ , unsigned char OverheadPercent = 5
+>
 class cached_adaptive_pool;
 
 
@@ -151,10 +157,10 @@
 //////////////////////////////////////////////////////////////////////////////
 
 //Single segment memory allocation algorithms
-template<class MutexFamily, class VoidMutex = void*>//offset_ptr<void> >
+template<class MutexFamily, class VoidMutex = offset_ptr<void> >
 class simple_seq_fit;
 
-template<class MutexFamily, class VoidMutex = offset_ptr<void> >
+template<class MutexFamily, class VoidMutex = offset_ptr<void>, std::size_t MemAlignment = 0>
 class rbtree_best_fit;
 
 //////////////////////////////////////////////////////////////////////////////

Modified: branches/fix-links/boost/interprocess/ipc/message_queue.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/ipc/message_queue.hpp (original)
+++ branches/fix-links/boost/interprocess/ipc/message_queue.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/managed_external_buffer.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/managed_external_buffer.hpp (original)
+++ branches/fix-links/boost/interprocess/managed_external_buffer.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -20,6 +20,7 @@
 #include <boost/interprocess/creation_tags.hpp>
 #include <boost/interprocess/detail/managed_memory_impl.hpp>
 #include <boost/interprocess/detail/move.hpp>
+#include <cassert>
 
 //!\file
 //!Describes a named user memory allocation user class.
@@ -49,6 +50,8 @@
    basic_managed_external_buffer
       (create_only_t, void *addr, std::size_t size)
    {
+ //Check if alignment is correct
+ assert((0 == (((std::size_t)addr) & (AllocationAlgorithm::Alignment - std::size_t(1u)))));
       if(!base_t::create_impl(addr, size)){
          throw interprocess_exception();
       }
@@ -58,6 +61,8 @@
    basic_managed_external_buffer
       (open_only_t, void *addr, std::size_t size)
    {
+ //Check if alignment is correct
+ assert((0 == (((std::size_t)addr) & (AllocationAlgorithm::Alignment - std::size_t(1u)))));
       if(!base_t::open_impl(addr, size)){
          throw interprocess_exception();
       }

Modified: branches/fix-links/boost/interprocess/managed_heap_memory.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/managed_heap_memory.hpp (original)
+++ branches/fix-links/boost/interprocess/managed_heap_memory.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/managed_mapped_file.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/managed_mapped_file.hpp (original)
+++ branches/fix-links/boost/interprocess/managed_mapped_file.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/managed_shared_memory.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/managed_shared_memory.hpp (original)
+++ branches/fix-links/boost/interprocess/managed_shared_memory.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/managed_windows_shared_memory.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/managed_windows_shared_memory.hpp (original)
+++ branches/fix-links/boost/interprocess/managed_windows_shared_memory.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/mapped_region.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/mapped_region.hpp (original)
+++ branches/fix-links/boost/interprocess/mapped_region.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/mem_algo/detail/mem_algo_common.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/mem_algo/detail/mem_algo_common.hpp (original)
+++ branches/fix-links/boost/interprocess/mem_algo/detail/mem_algo_common.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -104,6 +104,167 @@
    multi_allocation_next<VoidPointer> next_alloc_;
 };
 
+template<class VoidPointer>
+class basic_multiallocation_chain
+{
+ private:
+ basic_multiallocation_iterator<VoidPointer> it_;
+ VoidPointer last_mem_;
+ std::size_t num_mem_;
+
+ basic_multiallocation_chain(const basic_multiallocation_chain &);
+ basic_multiallocation_chain &operator=(const basic_multiallocation_chain &);
+
+ public:
+ typedef basic_multiallocation_iterator<VoidPointer> multiallocation_iterator;
+
+ basic_multiallocation_chain()
+ : it_(0), last_mem_(0), num_mem_(0)
+ {}
+
+ void push_back(void *mem)
+ {
+ typedef multi_allocation_next<VoidPointer> next_impl_t;
+ next_impl_t * tmp_mem = static_cast<next_impl_t*>(mem);
+
+ if(!this->last_mem_){
+ this->it_ = basic_multiallocation_iterator<VoidPointer>(tmp_mem);
+ }
+ else{
+ static_cast<next_impl_t*>(detail::get_pointer(this->last_mem_))->next_ = tmp_mem;
+ }
+ tmp_mem->next_ = 0;
+ this->last_mem_ = tmp_mem;
+ ++num_mem_;
+ }
+
+ void push_back(multiallocation_iterator it, std::size_t n)
+ {
+ typedef multi_allocation_next<VoidPointer> next_impl_t;
+ next_impl_t * tmp_mem = (next_impl_t*)(&*it);
+
+ if(!this->last_mem_){
+ this->it_ = it;
+ }
+ else{
+ static_cast<next_impl_t*>(detail::get_pointer(this->last_mem_))->next_ = tmp_mem;
+ }
+ tmp_mem->next_ = 0;
+ this->last_mem_ = tmp_mem;
+ ++num_mem_;
+ }
+
+ void push_front(void *mem)
+ {
+ typedef multi_allocation_next<VoidPointer> next_impl_t;
+
+ if(!this->last_mem_){
+ push_back(mem);
+ }
+ else{
+ next_impl_t * tmp_mem = static_cast<next_impl_t*>(mem);
+ next_impl_t * old_first = (next_impl_t*)(&*this->it_);
+ static_cast<next_impl_t*>(mem)->next_ = old_first;
+ this->it_ = basic_multiallocation_iterator<VoidPointer>(tmp_mem);
+ ++num_mem_;
+ }
+ }
+
+ void swap(basic_multiallocation_chain &other_chain)
+ {
+ std::swap(this->it_, other_chain.it_);
+ std::swap(this->last_mem_, other_chain.last_mem_);
+ std::swap(this->num_mem_, other_chain.num_mem_);
+ }
+
+ void splice_back(basic_multiallocation_chain &other_chain)
+ {
+ typedef multi_allocation_next<VoidPointer> next_impl_t;
+ multiallocation_iterator end_it;
+ multiallocation_iterator other_it = other_chain.get_it();
+ multiallocation_iterator this_it = this->get_it();
+ if(end_it == other_it){
+ return;
+ }
+ else if(end_it == other_it){
+ this->swap(other_chain);
+ }
+
+ static_cast<next_impl_t*>(detail::get_pointer(this->last_mem_))->next_
+ = (next_impl_t*)&*this->it_;
+ this->last_mem_ = other_chain.last_mem_;
+ this->num_mem_ += other_chain.num_mem_;
+ }
+
+ void *pop_front()
+ {
+ multiallocation_iterator itend;
+ if(this->it_ == itend){
+ this->last_mem_= 0;
+ this->num_mem_ = 0;
+ return 0;
+ }
+ else{
+ void *addr = &*it_;
+ ++it_;
+ --num_mem_;
+ if(!num_mem_){
+ this->last_mem_ = 0;
+ this->it_ = multiallocation_iterator();
+ }
+ return addr;
+ }
+ }
+
+ bool empty() const
+ { return !num_mem_; }
+
+ multiallocation_iterator get_it() const
+ { return it_; }
+
+ std::size_t size() const
+ { return num_mem_; }
+};
+
+template<class Allocator>
+class allocator_multiallocation_chain
+{
+ typedef typename detail::
+ pointer_to_other<typename Allocator::pointer, void>::type
+ void_ptr;
+
+ typedef typename Allocator::multiallocation_iterator multiallocation_iterator;
+ basic_multiallocation_chain<void_ptr> chain_;
+
+ public:
+
+ allocator_multiallocation_chain()
+ : chain_()
+ {}
+
+ void push_back(void *mem)
+ { chain_.push_back(mem); }
+
+ multiallocation_iterator get_it() const
+ { return multiallocation_iterator(chain_.get_it()); }
+};
+
+
+#define BOOST_MULTIALLOC_IT_CHAIN_INIT(IT_CHAIN) ((IT_CHAIN).it.next = 0, (IT_CHAIN).last_mem = 0)
+#define BOOST_MULTIALLOC_IT_CHAIN_ADD(IT_CHAIN, MEM)\
+ do{\
+ multialloc_it_t *____tmp_mem____ = (multialloc_it_t*)(MEM);\
+ if(!IT_CHAIN.last_mem){\
+ (IT_CHAIN).it.next = ____tmp_mem____;\
+ }else{\
+ ((multialloc_it_t*)(IT_CHAIN.last_mem))->next = ____tmp_mem____;\
+ }\
+ ____tmp_mem____->next = 0;\
+ IT_CHAIN.last_mem = ____tmp_mem____;\
+ }while(0)
+
+#define BOOST_MULTIALLOC_IT_CHAIN_IT(IT_CHAIN) ((IT_CHAIN).it)
+
 
 //!This class implements several allocation functions shared by different algorithms
 //!(aligned allocation, multiple allocation...).
@@ -125,6 +286,7 @@
    static const std::size_t AllocatedCtrlUnits = MemoryAlgorithm::AllocatedCtrlUnits;
    static const std::size_t BlockCtrlBytes = MemoryAlgorithm::BlockCtrlBytes;
    static const std::size_t BlockCtrlUnits = MemoryAlgorithm::BlockCtrlUnits;
+ static const std::size_t UsableByPreviousChunk = MemoryAlgorithm::UsableByPreviousChunk;
 
    static void assert_alignment(const void *ptr)
    { assert_alignment((std::size_t)ptr); }
@@ -165,10 +327,11 @@
    static void* allocate_aligned
       (MemoryAlgorithm *memory_algo, std::size_t nbytes, std::size_t alignment)
    {
+
       //Ensure power of 2
       if ((alignment & (alignment - std::size_t(1u))) != 0){
          //Alignment is not power of two
- BOOST_ASSERT((alignment & (alignment - std::size_t(1u))) != 0);
+ BOOST_ASSERT((alignment & (alignment - std::size_t(1u))) == 0);
          return 0;
       }
 
@@ -176,6 +339,9 @@
       if(alignment <= Alignment){
          return memory_algo->priv_allocate(allocate_new, nbytes, nbytes, real_size).first;
       }
+
+ if(nbytes > UsableByPreviousChunk)
+ nbytes -= UsableByPreviousChunk;
       
       //We can find a aligned portion if we allocate a chunk that has alignment
       //nbytes + alignment bytes or more.
@@ -191,7 +357,9 @@
       // | MBU |
       // -----------------------------------------------------
       std::size_t request =
- minimum_allocation + (2*MinBlockUnits*Alignment - AllocatedCtrlBytes);
+ minimum_allocation + (2*MinBlockUnits*Alignment - AllocatedCtrlBytes
+ //prevsize - UsableByPreviousChunk
+ );
 
       //Now allocate the buffer
       void *buffer = memory_algo->priv_allocate(allocate_new, request, request, real_size).first;
@@ -207,7 +375,8 @@
             max_value(ceil_units(nbytes) + AllocatedCtrlUnits, std::size_t(MinBlockUnits));
          //We can create a new block in the end of the segment
          if(old_size >= (first_min_units + MinBlockUnits)){
- block_ctrl *second = new((char*)first + Alignment*first_min_units) block_ctrl;
+ //block_ctrl *second = new((char*)first + Alignment*first_min_units) block_ctrl;
+ block_ctrl *second = (block_ctrl *)((char*)first + Alignment*first_min_units);
             first->m_size = first_min_units;
             second->m_size = old_size - first->m_size;
             BOOST_ASSERT(second->m_size >= MinBlockUnits);
@@ -285,6 +454,7 @@
       ,const std::size_t max_size, const std::size_t preferred_size
       ,std::size_t &received_size)
    {
+ (void)memory_algo;
       //Obtain the real block
       block_ctrl *block = memory_algo->priv_get_block(ptr);
       std::size_t old_block_units = block->m_size;
@@ -296,11 +466,11 @@
       assert_alignment(ptr);
 
       //Put this to a safe value
- received_size = (old_block_units - AllocatedCtrlUnits)*Alignment;
+ received_size = (old_block_units - AllocatedCtrlUnits)*Alignment + UsableByPreviousChunk;
 
       //Now translate it to Alignment units
- const std::size_t max_user_units = floor_units(max_size);
- const std::size_t preferred_user_units = ceil_units(preferred_size);
+ const std::size_t max_user_units = floor_units(max_size - UsableByPreviousChunk);
+ const std::size_t preferred_user_units = ceil_units(preferred_size - UsableByPreviousChunk);
 
       //Check if rounded max and preferred are possible correct
       if(max_user_units < preferred_user_units)
@@ -331,7 +501,7 @@
       }
 
       //Update new size
- received_size = shrunk_user_units*Alignment;
+ received_size = shrunk_user_units*Alignment + UsableByPreviousChunk;
       return true;
    }
 
@@ -350,22 +520,23 @@
       }
 
       //Check if the old size was just the shrunk size (no splitting)
- if((old_block_units - AllocatedCtrlUnits) == ceil_units(preferred_size))
+ if((old_block_units - AllocatedCtrlUnits) == ceil_units(preferred_size - UsableByPreviousChunk))
          return true;
 
       //Now we can just rewrite the size of the old buffer
- block->m_size = received_size/Alignment + AllocatedCtrlUnits;
+ block->m_size = (received_size-UsableByPreviousChunk)/Alignment + AllocatedCtrlUnits;
       BOOST_ASSERT(block->m_size >= BlockCtrlUnits);
- memory_algo->priv_mark_new_allocated_block(block);
 
       //We create the new block
- block_ctrl *new_block = new(reinterpret_cast<block_ctrl*>
- (detail::char_ptr_cast(block) + block->m_size*Alignment)) block_ctrl;
-
+// block_ctrl *new_block = new(reinterpret_cast<block_ctrl*>
+// (detail::char_ptr_cast(block) + block->m_size*Alignment)) block_ctrl;
+ block_ctrl *new_block = reinterpret_cast<block_ctrl*>
+ (detail::char_ptr_cast(block) + block->m_size*Alignment);
       //Write control data to simulate this new block was previously allocated
       //and deallocate it
       new_block->m_size = old_block_units - block->m_size;
       BOOST_ASSERT(new_block->m_size >= BlockCtrlUnits);
+ memory_algo->priv_mark_new_allocated_block(block);
       memory_algo->priv_mark_new_allocated_block(new_block);
       memory_algo->priv_deallocate(memory_algo->priv_get_user_buffer(new_block));
       return true;
@@ -401,11 +572,11 @@
       multi_allocation_next_ptr first = 0, previous = 0;
       std::size_t low_idx = 0;
       while(low_idx < n_elements){
- std::size_t total_bytes = total_request_units*Alignment - AllocatedCtrlBytes;
+ std::size_t total_bytes = total_request_units*Alignment - AllocatedCtrlBytes + UsableByPreviousChunk;
          std::size_t min_allocation = (!sizeof_element)
             ? elem_units
             : memory_algo->priv_get_total_units(elem_sizes[low_idx]*sizeof_element);
- min_allocation = min_allocation*Alignment - AllocatedCtrlBytes;
+ min_allocation = min_allocation*Alignment - AllocatedCtrlBytes + UsableByPreviousChunk;
 
          std::size_t received_size;
          std::pair<void *, bool> ret = memory_algo->priv_allocate
@@ -419,6 +590,7 @@
          char *block_address = (char*)block;
 
          std::size_t total_used_units = 0;
+// block_ctrl *prev_block = 0;
          while(total_used_units < received_units){
             if(sizeof_element){
                elem_units = memory_algo->priv_get_total_units(elem_sizes[low_idx]*sizeof_element);
@@ -428,7 +600,10 @@
                break;
             total_request_units -= elem_units;
             //This is the position where the new block must be created
- block_ctrl *new_block = new(block_address)block_ctrl;
+// if(prev_block)
+// memory_algo->priv_mark_new_allocated_block(prev_block);
+ block_ctrl *new_block = (block_ctrl *)(block_address);
+// block_ctrl *new_block = new(block_address)block_ctrl;
             assert_alignment(new_block);
 
             //The last block should take all the remaining space
@@ -446,7 +621,7 @@
                //split it obtaining a new free memory block do it.
                if((received_units - total_used_units) >= (elem_units + MemoryAlgorithm::BlockCtrlUnits)){
                   std::size_t shrunk_received;
- std::size_t shrunk_request = elem_units*Alignment - AllocatedCtrlBytes;
+ std::size_t shrunk_request = elem_units*Alignment - AllocatedCtrlBytes + UsableByPreviousChunk;
                   bool ret = shrink
                         (memory_algo
                         ,memory_algo->priv_get_user_buffer(new_block)
@@ -457,7 +632,7 @@
                   BOOST_ASSERT(ret);
                   //Some sanity checks
                   BOOST_ASSERT(shrunk_request == shrunk_received);
- BOOST_ASSERT(elem_units == (shrunk_request/Alignment + AllocatedCtrlUnits));
+ BOOST_ASSERT(elem_units == ((shrunk_request-UsableByPreviousChunk)/Alignment + AllocatedCtrlUnits));
                   //"new_block->m_size" must have been reduced to elem_units by "shrink"
                   BOOST_ASSERT(new_block->m_size == elem_units);
                   //Now update the total received units with the reduction
@@ -483,6 +658,7 @@
             }
             previous = p;
             ++low_idx;
+ //prev_block = new_block;
          }
          //Sanity check
          BOOST_ASSERT(total_used_units == received_units);

Modified: branches/fix-links/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp (original)
+++ branches/fix-links/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -64,6 +64,8 @@
 
    typedef detail::basic_multiallocation_iterator
       <void_pointer> multiallocation_iterator;
+ typedef detail::basic_multiallocation_chain
+ <void_pointer> multiallocation_chain;
 
    private:
    class block_ctrl;
@@ -137,6 +139,9 @@
    //!Multiple element allocation, different size
    multiallocation_iterator allocate_many(const std::size_t *elem_sizes, std::size_t n_elements, std::size_t sizeof_element);
 
+ //!Multiple element deallocation
+ void deallocate_many(multiallocation_iterator it);
+
    /// @endcond
 
    //!Deallocates previously allocated bytes
@@ -170,8 +175,13 @@
                            std::size_t preferred_size,std::size_t &received_size,
                            T *reuse_ptr = 0);
 
+ std::pair<void *, bool>
+ raw_allocation_command (allocation_type command, std::size_t limit_size,
+ std::size_t preferred_size,std::size_t &received_size,
+ void *reuse_ptr = 0, std::size_t sizeof_object = 1);
+
    //!Returns the size of the buffer previously allocated pointed by ptr
- std::size_t size(void *ptr) const;
+ std::size_t size(const void *ptr) const;
 
    //!Allocates aligned bytes, returns 0 if there is not more memory.
    //!Alignment must be power of 2
@@ -247,13 +257,16 @@
 
    void priv_mark_new_allocated_block(block_ctrl *block);
 
+ public:
    static const std::size_t Alignment = detail::alignment_of<detail::max_align>::value;
+ private:
    static const std::size_t BlockCtrlBytes = detail::ct_rounded_size<sizeof(block_ctrl), Alignment>::value;
    static const std::size_t BlockCtrlUnits = BlockCtrlBytes/Alignment;
    static const std::size_t MinBlockUnits = BlockCtrlUnits;
    static const std::size_t MinBlockSize = MinBlockUnits*Alignment;
    static const std::size_t AllocatedCtrlBytes = BlockCtrlBytes;
    static const std::size_t AllocatedCtrlUnits = BlockCtrlUnits;
+ static const std::size_t UsableByPreviousChunk = 0;
 
    public:
    static const std::size_t PayloadPerAllocation = BlockCtrlBytes;
@@ -549,19 +562,34 @@
                         std::size_t preferred_size,std::size_t &received_size,
                         T *reuse_ptr)
 {
- if(command & try_shrink_in_place){
- bool success =
- algo_impl_t::try_shrink(this, reuse_ptr, limit_size, preferred_size, received_size);
- return std::pair<T *, bool> ((success ? reuse_ptr : 0), true);
- }
    std::pair<void*, bool> ret = priv_allocation_command
       (command, limit_size, preferred_size, received_size, reuse_ptr, sizeof(T));
+
    BOOST_ASSERT(0 == ((std::size_t)ret.first % detail::alignment_of<T>::value));
    return std::pair<T *, bool>(static_cast<T*>(ret.first), ret.second);
 }
 
 template<class MutexFamily, class VoidPointer>
 inline std::pair<void*, bool> simple_seq_fit_impl<MutexFamily, VoidPointer>::
+ raw_allocation_command (allocation_type command, std::size_t limit_objects,
+ std::size_t preferred_objects,std::size_t &received_objects,
+ void *reuse_ptr, std::size_t sizeof_object)
+{
+ if(!sizeof_object)
+ return std::pair<void *, bool>(0, 0);
+ if(command & try_shrink_in_place){
+ bool success = algo_impl_t::try_shrink
+ ( this, reuse_ptr, limit_objects*sizeof_object
+ , preferred_objects*sizeof_object, received_objects);
+ received_objects /= sizeof_object;
+ return std::pair<void *, bool> ((success ? reuse_ptr : 0), true);
+ }
+ return priv_allocation_command
+ (command, limit_objects, preferred_objects, received_objects, reuse_ptr, sizeof_object);
+}
+
+template<class MutexFamily, class VoidPointer>
+inline std::pair<void*, bool> simple_seq_fit_impl<MutexFamily, VoidPointer>::
    priv_allocation_command (allocation_type command, std::size_t limit_size,
                        std::size_t preferred_size, std::size_t &received_size,
                        void *reuse_ptr, std::size_t sizeof_object)
@@ -589,13 +617,13 @@
 
 template<class MutexFamily, class VoidPointer>
 inline std::size_t simple_seq_fit_impl<MutexFamily, VoidPointer>::
- size(void *ptr) const
+ size(const void *ptr) const
 {
    //We need no synchronization since this block is not going
    //to be modified
    //Obtain the real size of the block
    block_ctrl *block = reinterpret_cast<block_ctrl*>
- (priv_get_block(detail::char_ptr_cast(ptr)));
+ (priv_get_block(detail::char_ptr_cast(const_cast<void*>(ptr))));
    return block->get_user_bytes();
 }
 
@@ -690,6 +718,20 @@
 }
 
 template<class MutexFamily, class VoidPointer>
+inline void simple_seq_fit_impl<MutexFamily, VoidPointer>::
+ deallocate_many(typename simple_seq_fit_impl<MutexFamily, VoidPointer>::multiallocation_iterator it)
+{
+ //-----------------------
+ boost::interprocess::scoped_lock<interprocess_mutex> guard(m_header);
+ //-----------------------
+ while(it){
+ void *addr = &*it;
+ ++it;
+ this->priv_deallocate(addr);
+ }
+}
+
+template<class MutexFamily, class VoidPointer>
 inline typename simple_seq_fit_impl<MutexFamily, VoidPointer>::multiallocation_iterator
    simple_seq_fit_impl<MutexFamily, VoidPointer>::
    allocate_many(const std::size_t *elem_sizes, std::size_t n_elements, std::size_t sizeof_element)

Modified: branches/fix-links/boost/interprocess/mem_algo/rbtree_best_fit.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/mem_algo/rbtree_best_fit.hpp (original)
+++ branches/fix-links/boost/interprocess/mem_algo/rbtree_best_fit.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -60,7 +60,7 @@
 
 //!This class implements an algorithm that stores the free nodes in a red-black tree
 //!to have logarithmic search/insert times.
-template<class MutexFamily, class VoidPointer>
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
 class rbtree_best_fit
 {
    /// @cond
@@ -77,6 +77,8 @@
    typedef VoidPointer void_pointer;
    typedef detail::basic_multiallocation_iterator
       <void_pointer> multiallocation_iterator;
+ typedef detail::basic_multiallocation_chain
+ <void_pointer> multiallocation_chain;
 
    /// @cond
 
@@ -106,9 +108,9 @@
    {
       //!This block's memory size (including block_ctrl
       //!header) in Alignment units
- std::size_t m_prev_size : sizeof(std::size_t)*CHAR_BIT - 1;
- std::size_t m_end : 1;
- std::size_t m_size : sizeof(std::size_t)*CHAR_BIT - 1;
+ std::size_t m_prev_size : sizeof(std::size_t)*CHAR_BIT;
+ std::size_t m_size : sizeof(std::size_t)*CHAR_BIT - 2;
+ std::size_t m_prev_allocated : 1;
       std::size_t m_allocated : 1;
    };
 
@@ -117,7 +119,7 @@
       : public SizeHolder, public TreeHook
    {
       block_ctrl()
- { this->m_end = 0; this->m_size = 0; this->m_allocated = 0; }
+ { this->m_size = 0; this->m_allocated = 0, this->m_prev_allocated = 0; }
 
       friend bool operator<(const block_ctrl &a, const block_ctrl &b)
       { return a.m_size < b.m_size; }
@@ -195,6 +197,9 @@
    //!Multiple element allocation, different size
    multiallocation_iterator allocate_many(const std::size_t *elem_sizes, std::size_t n_elements, std::size_t sizeof_element);
 
+ //!Multiple element allocation, different size
+ void deallocate_many(multiallocation_iterator it);
+
    /// @endcond
 
    //!Deallocates previously allocated bytes
@@ -230,6 +235,11 @@
                            std::size_t preferred_size,std::size_t &received_size,
                            T *reuse_ptr = 0);
 
+ std::pair<void *, bool>
+ raw_allocation_command (allocation_type command, std::size_t limit_object,
+ std::size_t preferred_object,std::size_t &received_object,
+ void *reuse_ptr = 0, std::size_t sizeof_object = 1);
+
    //!Returns the size of the buffer previously allocated pointed by ptr
    std::size_t size(const void *ptr) const;
 
@@ -279,17 +289,14 @@
                                ,bool only_preferred_backwards
                                ,std::size_t backwards_multiple);
 
- //!Set the size in the tail of the block
- void priv_tail_size(block_ctrl *ptr, std::size_t size);
+ //!Get poitner of the previous block (previous block must be free)
+ block_ctrl * priv_prev_block(block_ctrl *ptr);
 
- //!Real private aligned allocation function
- //void* priv_allocate_aligned (std::size_t nbytes, std::size_t alignment);
+ //!Returns true if the previous block is allocated
+ bool priv_is_prev_allocated(block_ctrl *ptr);
 
- //!Get the size in the tail of the block
- std::size_t priv_tail_size(block_ctrl *ptr);
-
- //!Get the size in the tail of the previous block
- block_ctrl * priv_prev_block(block_ctrl *ptr);
+ //!Get a pointer of the "end" block from the first block of the segment
+ block_ctrl * priv_end_block(block_ctrl *first_segment_block);
 
    //!Get the size in the tail of the previous block
    block_ctrl * priv_next_block(block_ctrl *ptr);
@@ -316,44 +323,50 @@
 
    void priv_mark_new_allocated_block(block_ctrl *block);
 
- static const std::size_t Alignment = detail::alignment_of<detail::max_align>::value;
+ public:
+
+ static const std::size_t Alignment = !MemAlignment
+ ? detail::alignment_of<detail::max_align>::value
+ : MemAlignment
+ ;
+
+ private:
    //Due to embedded bits in size, Alignment must be at least 2
- BOOST_STATIC_ASSERT((Alignment >= 2));
+ BOOST_STATIC_ASSERT((Alignment >= 4));
    //Due to rbtree size optimizations, Alignment must have at least pointer alignment
    BOOST_STATIC_ASSERT((Alignment >= detail::alignment_of<void_pointer>::value));
    static const std::size_t AlignmentMask = (Alignment - 1);
    static const std::size_t BlockCtrlBytes = detail::ct_rounded_size<sizeof(block_ctrl), Alignment>::value;
    static const std::size_t BlockCtrlUnits = BlockCtrlBytes/Alignment;
- static const std::size_t AllocatedCtrlBytes = detail::ct_rounded_size<sizeof(SizeHolder), Alignment>::value;
- static const std::size_t AllocatedCtrlUnits = AllocatedCtrlBytes/Alignment;
+ static const std::size_t AllocatedCtrlBytes = detail::ct_rounded_size<sizeof(SizeHolder), Alignment>::value;
+ static const std::size_t AllocatedCtrlUnits = AllocatedCtrlBytes/Alignment;
    static const std::size_t EndCtrlBlockBytes = detail::ct_rounded_size<sizeof(SizeHolder), Alignment>::value;
- static const std::size_t EndCtrlBlockUnits = EndCtrlBlockBytes/Alignment;
- static const std::size_t MinBlockUnits = BlockCtrlUnits;
+ static const std::size_t EndCtrlBlockUnits = EndCtrlBlockBytes/Alignment;
+ static const std::size_t MinBlockUnits = BlockCtrlUnits;
+ static const std::size_t UsableByPreviousChunk = sizeof(std::size_t);
 
    //Make sure the maximum alignment is power of two
    BOOST_STATIC_ASSERT((0 == (Alignment & (Alignment - std::size_t(1u)))));
    /// @endcond
    public:
- static const std::size_t PayloadPerAllocation = AllocatedCtrlBytes;
+ static const std::size_t PayloadPerAllocation = AllocatedCtrlBytes - UsableByPreviousChunk;
 };
 
-template<class MutexFamily, class VoidPointer>
-inline std::size_t rbtree_best_fit<MutexFamily, VoidPointer>
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+inline std::size_t rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>
    ::priv_first_block_offset(const void *this_ptr, std::size_t extra_hdr_bytes)
 {
- //First align "this" pointer
- std::size_t uint_this = (std::size_t)this_ptr;
- std::size_t uint_aligned_this = uint_this/Alignment*Alignment;
- std::size_t this_disalignment = (uint_this - uint_aligned_this);
- std::size_t block1_off =
- detail::get_rounded_size(sizeof(rbtree_best_fit) + extra_hdr_bytes + this_disalignment, Alignment)
- - this_disalignment;
- algo_impl_t::assert_alignment(this_disalignment + block1_off);
+ std::size_t uint_this = (std::size_t)this_ptr;
+ std::size_t main_hdr_end = uint_this + sizeof(rbtree_best_fit) + extra_hdr_bytes;
+ std::size_t aligned_main_hdr_end = detail::get_rounded_size(main_hdr_end, Alignment);
+ std::size_t block1_off = aligned_main_hdr_end - uint_this;
+ algo_impl_t::assert_alignment(aligned_main_hdr_end);
+ algo_impl_t::assert_alignment(uint_this + block1_off);
    return block1_off;
 }
 
-template<class MutexFamily, class VoidPointer>
-inline rbtree_best_fit<MutexFamily, VoidPointer>::
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+inline rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
    rbtree_best_fit(std::size_t size, std::size_t extra_hdr_bytes)
 {
    //Initialize the header
@@ -368,26 +381,25 @@
    priv_add_segment(detail::char_ptr_cast(this) + block1_off, size - block1_off);
 }
 
-template<class MutexFamily, class VoidPointer>
-inline rbtree_best_fit<MutexFamily, VoidPointer>::~rbtree_best_fit()
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+inline rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::~rbtree_best_fit()
 {
    //There is a memory leak!
 // assert(m_header.m_allocated == 0);
 // assert(m_header.m_root.m_next->m_next == block_ctrl_ptr(&m_header.m_root));
 }
 
-template<class MutexFamily, class VoidPointer>
-void rbtree_best_fit<MutexFamily, VoidPointer>::grow(std::size_t extra_size)
-{
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::grow(std::size_t extra_size)
+{
    //Get the address of the first block
    std::size_t block1_off =
       priv_first_block_offset(this, m_header.m_extra_hdr_bytes);
 
    block_ctrl *first_block = reinterpret_cast<block_ctrl *>
                                  (detail::char_ptr_cast(this) + block1_off);
- block_ctrl *old_end_block = priv_prev_block(first_block);
+ block_ctrl *old_end_block = priv_end_block(first_block);
    assert(priv_is_allocated_block(old_end_block));
- assert(old_end_block->m_end);
    std::size_t old_border_offset = (detail::char_ptr_cast(old_end_block) -
                                     detail::char_ptr_cast(this)) + EndCtrlBlockBytes;
 
@@ -406,18 +418,16 @@
       (detail::char_ptr_cast(old_end_block) + align_offset*Alignment);
    new_end_block->m_size = (detail::char_ptr_cast(first_block) -
                                  detail::char_ptr_cast(new_end_block))/Alignment;
+ first_block->m_prev_size = new_end_block->m_size;
    assert(first_block == priv_next_block(new_end_block));
- new_end_block->m_end = 1;
    priv_mark_new_allocated_block(new_end_block);
-
- assert(new_end_block == priv_prev_block(first_block));
+
+ assert(new_end_block == priv_end_block(first_block));
 
    //The old end block is the new block
- std::size_t old_end_prev = old_end_block->m_prev_size;
- block_ctrl *new_block = new(old_end_block)block_ctrl;
+ block_ctrl *new_block = old_end_block;
    new_block->m_size = (detail::char_ptr_cast(new_end_block) -
                         detail::char_ptr_cast(new_block))/Alignment;
- new_block->m_prev_size = old_end_prev;
    assert(new_block->m_size >= BlockCtrlUnits);
    priv_mark_new_allocated_block(new_block);
    assert(priv_next_block(new_block) == new_end_block);
@@ -428,8 +438,8 @@
    this->priv_deallocate(priv_get_user_buffer(new_block));
 }
 
-template<class MutexFamily, class VoidPointer>
-void rbtree_best_fit<MutexFamily, VoidPointer>::shrink_to_fit()
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::shrink_to_fit()
 {
    //Get the address of the first block
    std::size_t block1_off =
@@ -439,32 +449,36 @@
                                  (detail::char_ptr_cast(this) + block1_off);
    algo_impl_t::assert_alignment(first_block);
 
- block_ctrl *old_end_block = priv_prev_block(first_block);
+ block_ctrl *old_end_block = priv_end_block(first_block);
    algo_impl_t::assert_alignment(old_end_block);
    assert(priv_is_allocated_block(old_end_block));
- assert(old_end_block->m_end);
 
- block_ctrl *last_block = priv_prev_block(old_end_block);
    algo_impl_t::assert_alignment(old_end_block);
 
- std::size_t old_end_block_size = old_end_block->m_size;
+ std::size_t old_end_block_size = old_end_block->m_size;
 
- void *unique_block = 0;
- if(last_block == first_block){
+ void *unique_buffer = 0;
+ block_ctrl *last_block;
+ if(priv_next_block(first_block) == old_end_block){
       std::size_t ignore;
- unique_block = priv_allocate(allocate_new, 0, 0, ignore).first;
- if(!unique_block)
+ unique_buffer = priv_allocate(allocate_new, 0, 0, ignore).first;
+ if(!unique_buffer)
          return;
+ algo_impl_t::assert_alignment(unique_buffer);
+ block_ctrl *unique_block = priv_get_block(unique_buffer);
+ assert(priv_is_allocated_block(unique_block));
       algo_impl_t::assert_alignment(unique_block);
- last_block = priv_prev_block(old_end_block);
+ last_block = priv_next_block(unique_block);
+ assert(!priv_is_allocated_block(last_block));
       algo_impl_t::assert_alignment(last_block);
    }
+ else{
+ if(priv_is_prev_allocated(old_end_block))
+ return;
+ last_block = priv_prev_block(old_end_block);
+ }
 
- //The last block must be free to be able to shrink
- if(priv_is_allocated_block(last_block))
- return;
-
- std::size_t last_block_size = last_block->m_size;
+ std::size_t last_block_size = last_block->m_size;
 
    //Erase block from the free tree, since we will erase it
    m_header.m_imultiset.erase(Imultiset::s_iterator_to(*last_block));
@@ -474,20 +488,23 @@
    
    block_ctrl *new_end_block = last_block;
    algo_impl_t::assert_alignment(new_end_block);
- priv_mark_as_allocated_block(new_end_block);
- new_end_block->m_end = 1;
    new_end_block->m_size = old_end_block_size + last_block_size;
- priv_tail_size(new_end_block, new_end_block->m_size);
- assert(priv_prev_block(first_block) == new_end_block);
+ priv_mark_as_allocated_block(new_end_block);
+
+ //Although the first block might be allocated, we'll
+ //store the offset to the end block since in the previous
+ //offset can't be overwritten by a previous block
+ first_block->m_prev_size = new_end_block->m_size;
+ assert(priv_end_block(first_block) == new_end_block);
 
    //Update managed buffer's size
    m_header.m_size = shrunk_border_offset;
- if(unique_block)
- priv_deallocate(unique_block);
+ if(unique_buffer)
+ priv_deallocate(unique_buffer);
 }
 
-template<class MutexFamily, class VoidPointer>
-void rbtree_best_fit<MutexFamily, VoidPointer>::
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
    priv_add_segment(void *addr, std::size_t size)
 {
    //Check alignment
@@ -506,17 +523,15 @@
          (detail::char_ptr_cast(addr) + first_big_block->m_size*Alignment))SizeHolder);
 
    //This will overwrite the prev part of the "end" node
- priv_tail_size(first_big_block, first_big_block->m_size);
    priv_mark_as_free_block (first_big_block);
    first_big_block->m_prev_size = end_block->m_size =
       (detail::char_ptr_cast(first_big_block) - detail::char_ptr_cast(end_block))/Alignment;
- end_block->m_end = 1;
- end_block->m_allocated = 1;
+ priv_mark_as_allocated_block(end_block);
 
    assert(priv_next_block(first_big_block) == end_block);
- assert(priv_prev_block(end_block) == first_big_block);
    assert(priv_next_block(end_block) == first_big_block);
- assert(priv_prev_block(first_big_block) == end_block);
+ assert(priv_end_block(first_big_block) == end_block);
+ assert(priv_prev_block(end_block) == first_big_block);
 
    //Some check to validate the algorithm, since it makes some assumptions
    //to optimize the space wasted in bookkeeping:
@@ -530,27 +545,24 @@
    m_header.m_imultiset.insert(*first_big_block);
 }
 
-template<class MutexFamily, class VoidPointer>
-inline void rbtree_best_fit<MutexFamily, VoidPointer>::
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+inline void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
    priv_mark_new_allocated_block(block_ctrl *new_block)
-{
- priv_tail_size(new_block, new_block->m_size);
- priv_mark_as_allocated_block(new_block);
-}
+{ priv_mark_as_allocated_block(new_block); }
 
-template<class MutexFamily, class VoidPointer>
-inline std::size_t rbtree_best_fit<MutexFamily, VoidPointer>::get_size() const
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+inline std::size_t rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::get_size() const
 { return m_header.m_size; }
 
-template<class MutexFamily, class VoidPointer>
-inline std::size_t rbtree_best_fit<MutexFamily, VoidPointer>::get_free_memory() const
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+inline std::size_t rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::get_free_memory() const
 {
    return m_header.m_size - m_header.m_allocated -
       priv_first_block_offset(this, m_header.m_extra_hdr_bytes);
 }
 
-template<class MutexFamily, class VoidPointer>
-inline std::size_t rbtree_best_fit<MutexFamily, VoidPointer>::
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+inline std::size_t rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
    get_min_size (std::size_t extra_hdr_bytes)
 {
    return (algo_impl_t::ceil_units(sizeof(rbtree_best_fit)) +
@@ -558,8 +570,8 @@
            MinBlockUnits + EndCtrlBlockUnits)*Alignment;
 }
 
-template<class MutexFamily, class VoidPointer>
-inline bool rbtree_best_fit<MutexFamily, VoidPointer>::
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+inline bool rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
     all_memory_deallocated()
 {
    //-----------------------
@@ -575,8 +587,8 @@
          (m_header.m_size - block1_off - EndCtrlBlockBytes)/Alignment;
 }
 
-template<class MutexFamily, class VoidPointer>
-bool rbtree_best_fit<MutexFamily, VoidPointer>::
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+bool rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
     check_sanity()
 {
    //-----------------------
@@ -609,8 +621,8 @@
    return true;
 }
 
-template<class MutexFamily, class VoidPointer>
-inline void* rbtree_best_fit<MutexFamily, VoidPointer>::
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+inline void* rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
    allocate(std::size_t nbytes)
 {
    //-----------------------
@@ -621,8 +633,8 @@
    return ret;
 }
 
-template<class MutexFamily, class VoidPointer>
-inline void* rbtree_best_fit<MutexFamily, VoidPointer>::
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+inline void* rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
    allocate_aligned(std::size_t nbytes, std::size_t alignment)
 {
    //-----------------------
@@ -631,26 +643,42 @@
    return algo_impl_t::allocate_aligned(this, nbytes, alignment);
 }
 
-template<class MutexFamily, class VoidPointer>
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
 template<class T>
-inline std::pair<T*, bool> rbtree_best_fit<MutexFamily, VoidPointer>::
+inline std::pair<T*, bool> rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
    allocation_command (allocation_type command, std::size_t limit_size,
                         std::size_t preferred_size,std::size_t &received_size,
                         T *reuse_ptr)
 {
- if(command & try_shrink_in_place){
- bool success =
- algo_impl_t::try_shrink(this, reuse_ptr, limit_size, preferred_size, received_size);
- return std::pair<T *, bool> ((success ? reuse_ptr : 0), true);
- }
    std::pair<void*, bool> ret = priv_allocation_command
       (command, limit_size, preferred_size, received_size, reuse_ptr, sizeof(T));
+
    BOOST_ASSERT(0 == ((std::size_t)ret.first % detail::alignment_of<T>::value));
    return std::pair<T *, bool>(static_cast<T*>(ret.first), ret.second);
 }
 
-template<class MutexFamily, class VoidPointer>
-inline std::pair<void*, bool> rbtree_best_fit<MutexFamily, VoidPointer>::
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+inline std::pair<void*, bool> rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
+ raw_allocation_command (allocation_type command, std::size_t limit_objects,
+ std::size_t preferred_objects,std::size_t &received_objects,
+ void *reuse_ptr, std::size_t sizeof_object)
+{
+ if(!sizeof_object)
+ return std::pair<void *, bool>(0, 0);
+ if(command & try_shrink_in_place){
+ bool success = algo_impl_t::try_shrink
+ ( this, reuse_ptr, limit_objects*sizeof_object
+ , preferred_objects*sizeof_object, received_objects);
+ received_objects /= sizeof_object;
+ return std::pair<void *, bool> ((success ? reuse_ptr : 0), true);
+ }
+ return priv_allocation_command
+ (command, limit_objects, preferred_objects, received_objects, reuse_ptr, sizeof_object);
+}
+
+
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+inline std::pair<void*, bool> rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
    priv_allocation_command (allocation_type command, std::size_t limit_size,
                        std::size_t preferred_size,std::size_t &received_size,
                        void *reuse_ptr, std::size_t sizeof_object)
@@ -673,18 +701,18 @@
    return ret;
 }
 
-template<class MutexFamily, class VoidPointer>
-inline std::size_t rbtree_best_fit<MutexFamily, VoidPointer>::
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+inline std::size_t rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
    size(const void *ptr) const
 {
    //We need no synchronization since this block's size is not going
    //to be modified by anyone else
    //Obtain the real size of the block
- return (priv_get_block(ptr)->m_size - AllocatedCtrlUnits)*Alignment;
+ return (priv_get_block(ptr)->m_size - AllocatedCtrlUnits)*Alignment + UsableByPreviousChunk;
 }
 
-template<class MutexFamily, class VoidPointer>
-inline void rbtree_best_fit<MutexFamily, VoidPointer>::zero_free_memory()
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+inline void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::zero_free_memory()
 {
    //-----------------------
    boost::interprocess::scoped_lock<interprocess_mutex> guard(m_header);
@@ -700,8 +728,8 @@
    }
 }
 
-template<class MutexFamily, class VoidPointer>
-void* rbtree_best_fit<MutexFamily, VoidPointer>::
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+void* rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
    priv_expand_both_sides(allocation_type command
                          ,std::size_t min_size
                          ,std::size_t preferred_size
@@ -717,7 +745,7 @@
    }
    else{
       received_size = this->size(reuse_ptr);
- if(received_size >= preferred_size)
+ if(received_size >= preferred_size || received_size >= min_size)
          return reuse_ptr;
    }
 
@@ -731,18 +759,21 @@
       block_ctrl *reuse = priv_get_block(reuse_ptr);
 
       //Sanity check
- assert(reuse->m_size == priv_tail_size(reuse));
+ //assert(reuse->m_size == priv_tail_size(reuse));
       algo_impl_t::assert_alignment(reuse);
 
       block_ctrl *prev_block;
 
       //If the previous block is not free, there is nothing to do
- if(priv_is_allocated_block(prev_block = priv_prev_block(reuse))){
+ if(priv_is_prev_allocated(reuse)){
          return 0;
       }
 
+ prev_block = priv_prev_block(reuse);
+ assert(!priv_is_allocated_block(prev_block));
+
       //Some sanity checks
- assert(prev_block->m_size == priv_tail_size(prev_block));
+ assert(prev_block->m_size == reuse->m_prev_size);
       algo_impl_t::assert_alignment(prev_block);
 
       //Let's calculate the number of extra bytes of data before the current
@@ -769,32 +800,41 @@
       if(std::size_t(prev_block->m_size*Alignment) >= needs_backwards_aligned){
          //Now take all next space. This will succeed
          if(command & expand_fwd){
- if(!priv_expand(reuse_ptr, received_size, received_size, received_size)){
+ std::size_t received_size2;
+ if(!priv_expand(reuse_ptr, received_size, received_size, received_size2)){
                assert(0);
             }
+ assert(received_size = received_size2);
          }
          //We need a minimum size to split the previous one
          if(prev_block->m_size >= (needs_backwards_aligned/Alignment + BlockCtrlUnits)){
             block_ctrl *new_block = reinterpret_cast<block_ctrl *>
                (detail::char_ptr_cast(reuse) - needs_backwards_aligned);
 
- //Erase old previous block, since we will change it
- m_header.m_imultiset.erase(Imultiset::s_iterator_to(*prev_block));
-
             //Free old previous buffer
             new_block->m_size =
- AllocatedCtrlUnits + (needs_backwards_aligned + received_size)/Alignment;
+ AllocatedCtrlUnits + (needs_backwards_aligned + (received_size - UsableByPreviousChunk))/Alignment;
             assert(new_block->m_size >= BlockCtrlUnits);
             priv_mark_new_allocated_block(new_block);
 
             prev_block->m_size = (detail::char_ptr_cast(new_block) -
                                   detail::char_ptr_cast(prev_block))/Alignment;
             assert(prev_block->m_size >= BlockCtrlUnits);
- priv_tail_size(prev_block, prev_block->m_size);
             priv_mark_as_free_block(prev_block);
 
- //Insert the remaining previous block in the free tree
- m_header.m_imultiset.insert( m_header.m_imultiset.begin(), *prev_block);
+ //Update the old previous block in the free chunks tree
+ //If the new size fulfills tree invariants do nothing,
+ //otherwise erase() + insert()
+ {
+ imultiset_iterator prev_block_it(Imultiset::s_iterator_to(*prev_block));
+ imultiset_iterator was_smaller_it(prev_block_it);
+ if(prev_block_it != m_header.m_imultiset.begin() &&
+ (--(was_smaller_it = prev_block_it))->m_size > prev_block->m_size){
+ m_header.m_imultiset.erase(prev_block_it);
+ m_header.m_imultiset.insert(m_header.m_imultiset.begin(), *prev_block);
+ }
+ }
+
             received_size = needs_backwards_aligned + received_size;
             m_header.m_allocated += needs_backwards_aligned;
          
@@ -812,14 +852,15 @@
          //Check if there is no place to create a new block and
          //the whole new block is multiple of the backwards expansion multiple
          else if(prev_block->m_size >= needs_backwards_aligned/Alignment &&
- 0 == (prev_block->m_size % lcm)) {
+ 0 == ((prev_block->m_size*Alignment) % lcm)) {
             //Erase old previous block, since we will change it
             m_header.m_imultiset.erase(Imultiset::s_iterator_to(*prev_block));
 
             //Just merge the whole previous block
- const std::size_t needs_backwards_aligned = prev_block->m_size*Alignment;
- const std::size_t needs_backwards = detail::get_truncated_size(needs_backwards_aligned, backwards_multiple);
- received_size = received_size/backwards_multiple*backwards_multiple + needs_backwards;
+ needs_backwards = detail::get_truncated_size
+ (prev_block->m_size*Alignment, backwards_multiple);
+ //received_size = received_size/backwards_multiple*backwards_multiple + needs_backwards;
+ received_size = received_size + needs_backwards;
 
             m_header.m_allocated += prev_block->m_size*Alignment;
             //Now update sizes
@@ -843,9 +884,9 @@
    return 0;
 }
 
-template<class MutexFamily, class VoidPointer>
-inline typename rbtree_best_fit<MutexFamily, VoidPointer>::multiallocation_iterator
- rbtree_best_fit<MutexFamily, VoidPointer>::
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+inline typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::multiallocation_iterator
+ rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
    allocate_many(std::size_t elem_bytes, std::size_t num_elements)
 {
    //-----------------------
@@ -854,9 +895,23 @@
    return algo_impl_t::allocate_many(this, elem_bytes, num_elements);
 }
 
-template<class MutexFamily, class VoidPointer>
-inline typename rbtree_best_fit<MutexFamily, VoidPointer>::multiallocation_iterator
- rbtree_best_fit<MutexFamily, VoidPointer>::
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+inline void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
+ deallocate_many(typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::multiallocation_iterator it)
+{
+ //-----------------------
+ boost::interprocess::scoped_lock<interprocess_mutex> guard(m_header);
+ //-----------------------
+ while(it){
+ void *addr = &*it;
+ ++it;
+ this->priv_deallocate(addr);
+ }
+}
+
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+inline typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::multiallocation_iterator
+ rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
    allocate_many(const std::size_t *elem_sizes, std::size_t n_elements, std::size_t sizeof_element)
 {
    //-----------------------
@@ -865,8 +920,8 @@
    return algo_impl_t::allocate_many(this, elem_sizes, n_elements, sizeof_element);
 }
 
-template<class MutexFamily, class VoidPointer>
-std::pair<void *, bool> rbtree_best_fit<MutexFamily, VoidPointer>::
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+std::pair<void *, bool> rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
    priv_allocate(allocation_type command
                 ,std::size_t limit_size
                 ,std::size_t preferred_size
@@ -929,32 +984,34 @@
    return return_type(0, false);
 }
 
-template<class MutexFamily, class VoidPointer>
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
 inline
-typename rbtree_best_fit<MutexFamily, VoidPointer>::block_ctrl *
- rbtree_best_fit<MutexFamily, VoidPointer>::priv_get_block(const void *ptr)
+typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::block_ctrl *
+ rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::priv_get_block(const void *ptr)
 {
    return reinterpret_cast<block_ctrl*>(detail::char_ptr_cast(ptr) - AllocatedCtrlBytes);
 }
 
-template<class MutexFamily, class VoidPointer>
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
 inline
-void *rbtree_best_fit<MutexFamily, VoidPointer>::
- priv_get_user_buffer(const typename rbtree_best_fit<MutexFamily, VoidPointer>::block_ctrl *block)
+void *rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
+ priv_get_user_buffer(const typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::block_ctrl *block)
 { return detail::char_ptr_cast(block) + AllocatedCtrlBytes; }
 
-template<class MutexFamily, class VoidPointer>
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
 inline
-std::size_t rbtree_best_fit<MutexFamily, VoidPointer>::
+std::size_t rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
    priv_get_total_units(std::size_t userbytes)
 {
- std::size_t units = detail::get_rounded_size(userbytes, Alignment)/Alignment + AllocatedCtrlUnits;
+ if(userbytes < UsableByPreviousChunk)
+ userbytes = UsableByPreviousChunk;
+ std::size_t units = detail::get_rounded_size(userbytes - UsableByPreviousChunk, Alignment)/Alignment + AllocatedCtrlUnits;
    if(units < BlockCtrlUnits) units = BlockCtrlUnits;
    return units;
 }
 
-template<class MutexFamily, class VoidPointer>
-bool rbtree_best_fit<MutexFamily, VoidPointer>::
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+bool rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::
    priv_expand (void *ptr
                ,const std::size_t min_size
                ,const std::size_t preferred_size
@@ -966,16 +1023,16 @@
 
    //The block must be marked as allocated and the sizes must be equal
    assert(priv_is_allocated_block(block));
- assert(old_block_units == priv_tail_size(block));
+ //assert(old_block_units == priv_tail_size(block));
    
    //Put this to a safe value
- received_size = (old_block_units - AllocatedCtrlUnits)*Alignment;
- if(received_size > preferred_size)
+ received_size = (old_block_units - AllocatedCtrlUnits)*Alignment + UsableByPreviousChunk;
+ if(received_size >= preferred_size || received_size >= min_size)
       return true;
 
    //Now translate it to Alignment units
- const std::size_t min_user_units = algo_impl_t::ceil_units(min_size);
- const std::size_t preferred_user_units = algo_impl_t::ceil_units(preferred_size);
+ const std::size_t min_user_units = algo_impl_t::ceil_units(min_size - UsableByPreviousChunk);
+ const std::size_t preferred_user_units = algo_impl_t::ceil_units(preferred_size - UsableByPreviousChunk);
 
    //Some parameter checks
    assert(min_user_units <= preferred_user_units);
@@ -994,7 +1051,7 @@
    const std::size_t merged_user_units = merged_units - AllocatedCtrlUnits;
 
    if(merged_user_units < min_user_units){
- received_size = merged_user_units*Alignment;
+ received_size = merged_units*Alignment - UsableByPreviousChunk;
       return false;
    }
 
@@ -1007,30 +1064,44 @@
 
    //Check if we can split the next one in two parts
    if((merged_units - intended_units) >= BlockCtrlUnits){
- //Now we have to update the data in the tree
- m_header.m_imultiset.erase(Imultiset::s_iterator_to(*next_block));
-
       //This block is bigger than needed, split it in
       //two blocks, the first one will be merged and
       //the second's size will be the remaining space
- assert(next_block->m_size == priv_tail_size(next_block));
+ assert(next_block->m_size == priv_next_block(next_block)->m_prev_size);
+ const std::size_t rem_units = merged_units - intended_units;
 
+ //Check if we we need to update the old next block in the free chunks tree
+ //If the new size fulfills tree invariants, we just need to replace the node
+ //(the block start has been displaced), otherwise erase() + insert().
+ //
+ //This fixup must be done in two parts, because the new next chunk might
+ //overwrite the tree hook of the old next chunk. So we first erase the
+ //old if needed and we'll insert the new one after creating the new next
+ imultiset_iterator old_next_block_it(Imultiset::s_iterator_to(*next_block));
+ const bool size_invariants_broken =
+ (next_block->m_size - rem_units ) < BlockCtrlUnits ||
+ (old_next_block_it != m_header.m_imultiset.begin() &&
+ (--imultiset_iterator(old_next_block_it))->m_size > rem_units);
+ if(size_invariants_broken){
+ m_header.m_imultiset.erase(old_next_block_it);
+ }
       //This is the remaining block
- block_ctrl *new_block = new(reinterpret_cast<block_ctrl*>
+ block_ctrl *rem_block = new(reinterpret_cast<block_ctrl*>
                      (detail::char_ptr_cast(block) + intended_units*Alignment))block_ctrl;
- new_block->m_size = merged_units - intended_units;
- algo_impl_t::assert_alignment(new_block);
- assert(new_block->m_size >= BlockCtrlUnits);
- priv_tail_size(new_block, new_block->m_size);
- priv_mark_as_free_block(new_block);
-
- //Insert the new block in the container
- m_header.m_imultiset.insert(m_header.m_imultiset.begin(), *new_block);
+ rem_block->m_size = rem_units;
+ algo_impl_t::assert_alignment(rem_block);
+ assert(rem_block->m_size >= BlockCtrlUnits);
+ priv_mark_as_free_block(rem_block);
+
+ //Now the second part of the fixup
+ if(size_invariants_broken)
+ m_header.m_imultiset.insert(m_header.m_imultiset.begin(), *rem_block);
+ else
+ m_header.m_imultiset.replace_node(old_next_block_it, *rem_block);
 
       //Write the new length
       block->m_size = intended_user_units + AllocatedCtrlUnits;
       assert(block->m_size >= BlockCtrlUnits);
- priv_tail_size(block, block->m_size);
       m_header.m_allocated += (intended_units - old_block_units)*Alignment;
    }
    //There is no free space to create a new node: just merge both blocks
@@ -1041,61 +1112,95 @@
       //Write the new length
       block->m_size = merged_units;
       assert(block->m_size >= BlockCtrlUnits);
- priv_tail_size(block, merged_units);
       m_header.m_allocated += (merged_units - old_block_units)*Alignment;
    }
-
- received_size = (block->m_size - AllocatedCtrlUnits)*Alignment;
+ priv_mark_as_allocated_block(block);
+ received_size = (block->m_size - AllocatedCtrlUnits)*Alignment + UsableByPreviousChunk;
    return true;
 }
 
-template<class MutexFamily, class VoidPointer> inline
-void rbtree_best_fit<MutexFamily, VoidPointer>::priv_tail_size
- (typename rbtree_best_fit<MutexFamily, VoidPointer>::block_ctrl *ptr, std::size_t size)
-{ priv_next_block(ptr)->m_prev_size = size; }
-
-template<class MutexFamily, class VoidPointer> inline
-std::size_t rbtree_best_fit<MutexFamily, VoidPointer>::priv_tail_size
- (typename rbtree_best_fit<MutexFamily, VoidPointer>::block_ctrl *ptr)
-{ return priv_next_block(ptr)->m_prev_size; }
-
-template<class MutexFamily, class VoidPointer> inline
-typename rbtree_best_fit<MutexFamily, VoidPointer>::block_ctrl *
- rbtree_best_fit<MutexFamily, VoidPointer>::priv_prev_block
- (typename rbtree_best_fit<MutexFamily, VoidPointer>::block_ctrl *ptr)
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment> inline
+typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::block_ctrl *
+ rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::priv_prev_block
+ (typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::block_ctrl *ptr)
 {
+ assert(!ptr->m_prev_allocated);
    return reinterpret_cast<block_ctrl *>
       (detail::char_ptr_cast(ptr) - ptr->m_prev_size*Alignment);
 }
 
-template<class MutexFamily, class VoidPointer> inline
-typename rbtree_best_fit<MutexFamily, VoidPointer>::block_ctrl *
- rbtree_best_fit<MutexFamily, VoidPointer>::priv_next_block
- (typename rbtree_best_fit<MutexFamily, VoidPointer>::block_ctrl *ptr)
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment> inline
+bool rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::priv_is_prev_allocated
+ (typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::block_ctrl *ptr)
+{
+ if(ptr->m_prev_allocated){
+ return true;
+ }
+ else{
+ block_ctrl *prev = priv_prev_block(ptr);
+ assert(!priv_is_allocated_block(prev));
+ return false;
+ }
+}
+
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment> inline
+typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::block_ctrl *
+ rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::priv_end_block
+ (typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::block_ctrl *first_segment_block)
+{
+ assert(first_segment_block->m_prev_allocated);
+ block_ctrl *end_block = reinterpret_cast<block_ctrl *>
+ (detail::char_ptr_cast(first_segment_block) - first_segment_block->m_prev_size*Alignment);
+ assert(priv_is_allocated_block(end_block));
+ assert(end_block > first_segment_block);
+ return end_block;
+}
+
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment> inline
+typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::block_ctrl *
+ rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::priv_next_block
+ (typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::block_ctrl *ptr)
 {
    return reinterpret_cast<block_ctrl *>
       (detail::char_ptr_cast(ptr) + ptr->m_size*Alignment);
 }
 
-template<class MutexFamily, class VoidPointer> inline
-bool rbtree_best_fit<MutexFamily, VoidPointer>::priv_is_allocated_block
- (typename rbtree_best_fit<MutexFamily, VoidPointer>::block_ctrl *block)
-{ return block->m_allocated != 0; }
-
-template<class MutexFamily, class VoidPointer> inline
-void rbtree_best_fit<MutexFamily, VoidPointer>::priv_mark_as_allocated_block
- (typename rbtree_best_fit<MutexFamily, VoidPointer>::block_ctrl *block)
-{ block->m_allocated = 1; }
-
-template<class MutexFamily, class VoidPointer> inline
-void rbtree_best_fit<MutexFamily, VoidPointer>::priv_mark_as_free_block
- (typename rbtree_best_fit<MutexFamily, VoidPointer>::block_ctrl *block)
-{ block->m_allocated = 0; }
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment> inline
+bool rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::priv_is_allocated_block
+ (typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::block_ctrl *block)
+{
+ bool allocated = block->m_allocated != 0;
+ block_ctrl *next_block = (block_ctrl *)
+ (detail::char_ptr_cast(block) + block->m_size*Alignment);
+ bool next_block_prev_allocated = next_block->m_prev_allocated != 0;
+ (void)next_block_prev_allocated;
+ assert(allocated == next_block_prev_allocated);
+ return allocated;
+}
 
-template<class MutexFamily, class VoidPointer> inline
-void* rbtree_best_fit<MutexFamily, VoidPointer>::priv_check_and_allocate
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment> inline
+void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::priv_mark_as_allocated_block
+ (typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::block_ctrl *block)
+{
+ //assert(!priv_is_allocated_block(block));
+ block->m_allocated = 1;
+ ((block_ctrl *)(((char*)block) + block->m_size*Alignment))->m_prev_allocated = 1;
+}
+
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment> inline
+void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::priv_mark_as_free_block
+ (typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::block_ctrl *block)
+{
+ block->m_allocated = 0;
+ ((block_ctrl *)(((char*)block) + block->m_size*Alignment))->m_prev_allocated = 0;
+ //assert(!priv_is_allocated_block(ptr));
+ priv_next_block(block)->m_prev_size = block->m_size;
+}
+
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment> inline
+void* rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::priv_check_and_allocate
    (std::size_t nunits
- ,typename rbtree_best_fit<MutexFamily, VoidPointer>::block_ctrl* block
+ ,typename rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::block_ctrl* block
    ,std::size_t &received_size)
 {
    std::size_t upper_nunits = nunits + BlockCtrlUnits;
@@ -1109,32 +1214,30 @@
       std::size_t block_old_size = block->m_size;
       block->m_size = nunits;
       assert(block->m_size >= BlockCtrlUnits);
- priv_tail_size(block, block->m_size);
 
       //This is the remaining block
- block_ctrl *new_block = new(reinterpret_cast<block_ctrl*>
+ block_ctrl *rem_block = new(reinterpret_cast<block_ctrl*>
                      (detail::char_ptr_cast(block) + Alignment*nunits))block_ctrl;
- algo_impl_t::assert_alignment(new_block);
- new_block->m_size = block_old_size - nunits;
- assert(new_block->m_size >= BlockCtrlUnits);
- priv_tail_size(new_block, new_block->m_size);
- priv_mark_as_free_block(new_block);
+ algo_impl_t::assert_alignment(rem_block);
+ rem_block->m_size = block_old_size - nunits;
+ assert(rem_block->m_size >= BlockCtrlUnits);
+ priv_mark_as_free_block(rem_block);
 
       imultiset_iterator it_hint;
       if(it_old == m_header.m_imultiset.begin()
- || (--imultiset_iterator(it_old))->m_size < new_block->m_size){
+ || (--imultiset_iterator(it_old))->m_size < rem_block->m_size){
          //option a: slow but secure
- //m_header.m_imultiset.insert(m_header.m_imultiset.erase(it_old), *new_block);
+ //m_header.m_imultiset.insert(m_header.m_imultiset.erase(it_old), *rem_block);
          //option b: Construct an empty node and swap
- //Imultiset::init_node(*new_block);
- //block->swap_nodes(*new_block);
+ //Imultiset::init_node(*rem_block);
+ //block->swap_nodes(*rem_block);
          //option c: replace the node directly
- m_header.m_imultiset.replace_node(Imultiset::s_iterator_to(*it_old), *new_block);
+ m_header.m_imultiset.replace_node(Imultiset::s_iterator_to(*it_old), *rem_block);
       }
       else{
          //Now we have to update the data in the tree
          m_header.m_imultiset.erase(it_old);
- m_header.m_imultiset.insert(m_header.m_imultiset.begin(), *new_block);
+ m_header.m_imultiset.insert(m_header.m_imultiset.begin(), *rem_block);
       }
          
    }
@@ -1148,7 +1251,7 @@
    //We need block_ctrl for deallocation stuff, so
    //return memory user can overwrite
    m_header.m_allocated += block->m_size*Alignment;
- received_size = (block->m_size - AllocatedCtrlUnits)*Alignment;
+ received_size = (block->m_size - AllocatedCtrlUnits)*Alignment + UsableByPreviousChunk;
 
    //Mark the block as allocated
    priv_mark_as_allocated_block(block);
@@ -1157,11 +1260,12 @@
    //cleared with zero_free_memory
    TreeHook *t = static_cast<TreeHook*>(block);
    std::memset(t, 0, sizeof(*t));
+ this->priv_next_block(block)->m_prev_size = 0;
    return priv_get_user_buffer(block);
 }
 
-template<class MutexFamily, class VoidPointer>
-void rbtree_best_fit<MutexFamily, VoidPointer>::deallocate(void* addr)
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::deallocate(void* addr)
 {
    if(!addr) return;
    //-----------------------
@@ -1170,8 +1274,8 @@
    return this->priv_deallocate(addr);
 }
 
-template<class MutexFamily, class VoidPointer>
-void rbtree_best_fit<MutexFamily, VoidPointer>::priv_deallocate(void* addr)
+template<class MutexFamily, class VoidPointer, std::size_t MemAlignment>
+void rbtree_best_fit<MutexFamily, VoidPointer, MemAlignment>::priv_deallocate(void* addr)
 {
    if(!addr) return;
 
@@ -1179,7 +1283,7 @@
   
    //The blocks must be marked as allocated and the sizes must be equal
    assert(priv_is_allocated_block(block));
- assert(block->m_size == priv_tail_size(block));
+// assert(block->m_size == priv_tail_size(block));
 
    //Check if alignment and block size are right
    algo_impl_t::assert_alignment(addr);
@@ -1194,33 +1298,48 @@
    block_ctrl *block_to_insert = block;
 
    //Get the next block
- block_ctrl *next_block = priv_next_block(block);
+ block_ctrl *next_block = priv_next_block(block);
+ bool merge_with_prev = !priv_is_prev_allocated(block);
+ bool merge_with_next = !priv_is_allocated_block(next_block);
+
+ //Merge logic. First just update block sizes, then fix free chunks tree
+ if(merge_with_prev || merge_with_next){
+ //Merge if the previous is free
+ if(merge_with_prev){
+ //Get the previous block
+ block_ctrl *prev_block = priv_prev_block(block);
+ prev_block->m_size += block->m_size;
+ assert(prev_block->m_size >= BlockCtrlUnits);
+ block_to_insert = prev_block;
+ }
+ //Merge if the next is free
+ if(merge_with_next){
+ block_to_insert->m_size += next_block->m_size;
+ assert(block_to_insert->m_size >= BlockCtrlUnits);
+ if(merge_with_prev)
+ m_header.m_imultiset.erase(Imultiset::s_iterator_to(*next_block));
+ }
 
- //Merge if the next is free
- if(!priv_is_allocated_block(next_block)){
- block->m_size += next_block->m_size;
- assert(block->m_size >= BlockCtrlUnits);
- priv_tail_size(block, block->m_size);
- m_header.m_imultiset.erase(Imultiset::s_iterator_to(*next_block));
+ bool only_merge_next = !merge_with_prev && merge_with_next;
+ imultiset_iterator free_block_to_check_it
+ (Imultiset::s_iterator_to(only_merge_next ? *next_block : *block_to_insert));
+ imultiset_iterator was_bigger_it(free_block_to_check_it);
+
+ //Now try to shortcut erasure + insertion (O(log(N))) with
+ //a O(1) operation if merging does not alter tree positions
+ if(++was_bigger_it != m_header.m_imultiset.end() &&
+ block_to_insert->m_size > was_bigger_it->m_size ){
+ m_header.m_imultiset.erase(free_block_to_check_it);
+ m_header.m_imultiset.insert(m_header.m_imultiset.begin(), *block_to_insert);
+ }
+ else if(only_merge_next){
+ m_header.m_imultiset.replace_node(free_block_to_check_it, *block_to_insert);
+ }
    }
-
- //Get the previous block
- block_ctrl *prev_block = priv_prev_block(block);
-
- //Now check that tail size and control size are equal
- assert(prev_block->m_size == priv_tail_size(prev_block));
-
- //Merge if the previous is free
- if(!priv_is_allocated_block(prev_block)){
- prev_block->m_size += block->m_size;
- assert(prev_block->m_size >= BlockCtrlUnits);
- priv_tail_size(prev_block, prev_block->m_size);
- m_header.m_imultiset.erase(Imultiset::s_iterator_to(*prev_block));
- block_to_insert = prev_block;
+ else{
+ m_header.m_imultiset.insert(m_header.m_imultiset.begin(), *block_to_insert);
    }
-
    priv_mark_as_free_block(block_to_insert);
- m_header.m_imultiset.insert(m_header.m_imultiset.begin(), *block_to_insert);
 }
 
 } //namespace interprocess {

Modified: branches/fix-links/boost/interprocess/mem_algo/simple_seq_fit.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/mem_algo/simple_seq_fit.hpp (original)
+++ branches/fix-links/boost/interprocess/mem_algo/simple_seq_fit.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/offset_ptr.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/offset_ptr.hpp (original)
+++ branches/fix-links/boost/interprocess/offset_ptr.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -61,7 +61,7 @@
    typedef void (self_t::*unspecified_bool_type)() const;
 
    #if defined(_MSC_VER) && (_MSC_VER >= 1400)
- __declspec(noinline)
+ __declspec(noinline) //this workaround is needed for msvc-8.0 and msvc-9.0
    #endif
    void set_offset(const volatile void *ptr)
    {
@@ -77,7 +77,7 @@
    }
 
    #if defined(_MSC_VER) && (_MSC_VER >= 1400)
- __declspec(noinline)
+ __declspec(noinline) //this workaround is needed for msvc-8.0 and msvc-9.0
    #endif
    void* get_pointer() const
    { return (m_offset == 1) ? 0 : (detail::char_ptr_cast(this) + m_offset); }

Modified: branches/fix-links/boost/interprocess/segment_manager.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/segment_manager.hpp (original)
+++ branches/fix-links/boost/interprocess/segment_manager.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //
@@ -70,7 +70,8 @@
    /// @cond
    
    //Experimental. Don't use
- typedef typename MemoryAlgorithm::multiallocation_iterator multiallocation_iterator;
+ typedef typename MemoryAlgorithm::multiallocation_iterator multiallocation_iterator;
+ typedef typename MemoryAlgorithm::multiallocation_chain multiallocation_chain;
 
    /// @endcond
 
@@ -148,6 +149,11 @@
    multiallocation_iterator allocate_many(const std::size_t *elem_sizes, std::size_t n_elements, std::size_t sizeof_element, std::nothrow_t)
    { return MemoryAlgorithm::allocate_many(elem_sizes, n_elements, sizeof_element); }
 
+ //!Deallocates elements pointed by the
+ //!multiallocation iterator range.
+ void deallocate_many(multiallocation_iterator it)
+ { MemoryAlgorithm::deallocate_many(it); }
+
    /// @endcond
 
    //!Allocates nbytes bytes. Throws boost::interprocess::bad_alloc
@@ -189,6 +195,19 @@
       return ret;
    }
 
+ std::pair<void *, bool>
+ raw_allocation_command (allocation_type command, std::size_t limit_objects,
+ std::size_t preferred_objects,std::size_t &received_objects,
+ void *reuse_ptr = 0, std::size_t sizeof_object = 1)
+ {
+ std::pair<void *, bool> ret = MemoryAlgorithm::raw_allocation_command
+ ( command | nothrow_allocation, limit_objects, preferred_objects, received_objects
+ , reuse_ptr, sizeof_object);
+ if(!(command & nothrow_allocation) && !ret.first)
+ throw bad_alloc();
+ return ret;
+ }
+
    //!Deallocates the bytes allocated with allocate/allocate_many()
    //!pointed by addr
    void deallocate (void *addr)
@@ -219,6 +238,10 @@
    void zero_free_memory()
    { MemoryAlgorithm::zero_free_memory(); }
 
+ //!Returns the size of the buffer previously allocated pointed by ptr
+ std::size_t size(const void *ptr) const
+ { return MemoryAlgorithm::size(ptr); }
+
    /// @cond
    protected:
    void * prot_anonymous_construct

Modified: branches/fix-links/boost/interprocess/shared_memory_object.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/shared_memory_object.hpp (original)
+++ branches/fix-links/boost/interprocess/shared_memory_object.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/smart_ptr/deleter.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/smart_ptr/deleter.hpp (original)
+++ branches/fix-links/boost/interprocess/smart_ptr/deleter.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007.
+// (C) Copyright Ion Gaztanaga 2007-2008.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/fix-links/boost/interprocess/smart_ptr/detail/shared_count.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/smart_ptr/detail/shared_count.hpp (original)
+++ branches/fix-links/boost/interprocess/smart_ptr/detail/shared_count.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -4,7 +4,7 @@
 //
 // (C) Copyright Peter Dimov and Multi Media Ltd. 2001, 2002, 2003
 // (C) Copyright Peter Dimov 2004-2005
-// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2006-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/smart_ptr/detail/sp_counted_base_atomic.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/smart_ptr/detail/sp_counted_base_atomic.hpp (original)
+++ branches/fix-links/boost/interprocess/smart_ptr/detail/sp_counted_base_atomic.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -9,7 +9,7 @@
 
 // Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
 // Copyright 2004-2005 Peter Dimov
-// Copyright 2007 Ion Gaztanaga
+// Copyright 2007-2008 Ion Gaztanaga
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at

Modified: branches/fix-links/boost/interprocess/smart_ptr/shared_ptr.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/smart_ptr/shared_ptr.hpp (original)
+++ branches/fix-links/boost/interprocess/smart_ptr/shared_ptr.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -4,7 +4,7 @@
 //
 // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
 // (C) Copyright Peter Dimov 2001, 2002, 2003
-// (C) Copyright Ion Gaztanaga 2006-2007.
+// (C) Copyright Ion Gaztanaga 2006-2008.
 // 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)

Modified: branches/fix-links/boost/interprocess/smart_ptr/weak_ptr.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/smart_ptr/weak_ptr.hpp (original)
+++ branches/fix-links/boost/interprocess/smart_ptr/weak_ptr.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 // This file is the adaptation for Interprocess of boost/weak_ptr.hpp
 //
 // (C) Copyright Peter Dimov 2001, 2002, 2003
-// (C) Copyright Ion Gaztanaga 2006-2007.
+// (C) Copyright Ion Gaztanaga 2006-2008.
 // 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)

Modified: branches/fix-links/boost/interprocess/streams/bufferstream.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/streams/bufferstream.hpp (original)
+++ branches/fix-links/boost/interprocess/streams/bufferstream.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/streams/vectorstream.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/streams/vectorstream.hpp (original)
+++ branches/fix-links/boost/interprocess/streams/vectorstream.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/emulation/interprocess_condition.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/emulation/interprocess_condition.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/emulation/interprocess_condition.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/emulation/interprocess_mutex.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/emulation/interprocess_mutex.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/emulation/interprocess_mutex.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/emulation/interprocess_recursive_mutex.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/emulation/interprocess_recursive_mutex.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/emulation/interprocess_recursive_mutex.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/emulation/interprocess_semaphore.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/emulation/interprocess_semaphore.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/emulation/interprocess_semaphore.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/emulation/named_creation_functor.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/emulation/named_creation_functor.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/emulation/named_creation_functor.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2007-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/file_lock.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/file_lock.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/file_lock.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/interprocess_barrier.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/interprocess_barrier.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/interprocess_barrier.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/interprocess_condition.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/interprocess_condition.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/interprocess_condition.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/interprocess_mutex.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/interprocess_mutex.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/interprocess_mutex.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/interprocess_recursive_mutex.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/interprocess_recursive_mutex.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/interprocess_recursive_mutex.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/interprocess_semaphore.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/interprocess_semaphore.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/interprocess_semaphore.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/interprocess_upgradable_mutex.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/interprocess_upgradable_mutex.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/interprocess_upgradable_mutex.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/lock_options.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/lock_options.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/lock_options.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/mutex_family.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/mutex_family.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/mutex_family.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/named_condition.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/named_condition.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/named_condition.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/named_mutex.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/named_mutex.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/named_mutex.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/named_recursive_mutex.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/named_recursive_mutex.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/named_recursive_mutex.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/named_semaphore.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/named_semaphore.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/named_semaphore.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
  //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/named_upgradable_mutex.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/named_upgradable_mutex.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/named_upgradable_mutex.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/null_mutex.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/null_mutex.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/null_mutex.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/posix/interprocess_condition.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/posix/interprocess_condition.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/posix/interprocess_condition.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/posix/interprocess_mutex.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/posix/interprocess_mutex.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/posix/interprocess_mutex.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/posix/interprocess_recursive_mutex.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/posix/interprocess_recursive_mutex.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/posix/interprocess_recursive_mutex.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/posix/interprocess_semaphore.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/posix/interprocess_semaphore.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/posix/interprocess_semaphore.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/posix/pthread_helpers.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/posix/pthread_helpers.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/posix/pthread_helpers.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/posix/ptime_to_timespec.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/posix/ptime_to_timespec.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/posix/ptime_to_timespec.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/posix/semaphore_wrapper.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/posix/semaphore_wrapper.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/posix/semaphore_wrapper.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/scoped_lock.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/scoped_lock.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/scoped_lock.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/sharable_lock.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/sharable_lock.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/sharable_lock.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/sync/upgradable_lock.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/sync/upgradable_lock.hpp (original)
+++ branches/fix-links/boost/interprocess/sync/upgradable_lock.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/interprocess/windows_shared_memory.hpp
==============================================================================
--- branches/fix-links/boost/interprocess/windows_shared_memory.hpp (original)
+++ branches/fix-links/boost/interprocess/windows_shared_memory.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2008. 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)
 //

Modified: branches/fix-links/boost/intrusive/circular_list_algorithms.hpp
==============================================================================
--- branches/fix-links/boost/intrusive/circular_list_algorithms.hpp (original)
+++ branches/fix-links/boost/intrusive/circular_list_algorithms.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -54,6 +54,27 @@
    typedef typename NodeTraits::const_node_ptr const_node_ptr;
    typedef NodeTraits node_traits;
 
+ //! <b>Effects</b>: Constructs an non-used list element, so that
+ //! inited(this_node) == true
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void init(node_ptr this_node)
+ {
+ NodeTraits::set_next(this_node, 0);
+ NodeTraits::set_previous(this_node, 0);
+ }
+
+ //! <b>Effects</b>: Returns true is "this_node" is in a non-used state
+ //! as if it was initialized by the "init" function.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool inited(const_node_ptr this_node)
+ { return !NodeTraits::get_next(this_node); }
+
    //! <b>Effects</b>: Constructs an empty list, making this_node the only
    //! node of the circular list:
    //! <tt>NodeTraits::get_next(this_node) == NodeTraits::get_previous(this_node)
@@ -62,11 +83,12 @@
    //! <b>Complexity</b>: Constant
    //!
    //! <b>Throws</b>: Nothing.
- static void init(node_ptr this_node)
+ static void init_header(node_ptr this_node)
    {
       NodeTraits::set_next(this_node, this_node);
       NodeTraits::set_previous(this_node, this_node);
- }
+ }
+
 
    //! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
    //!
@@ -76,8 +98,11 @@
    //! <b>Complexity</b>: Constant
    //!
    //! <b>Throws</b>: Nothing.
- static bool unique(const_node_ptr this_node)
- { return NodeTraits::get_next(this_node) == this_node; }
+ static bool unique(const_node_ptr this_node)
+ {
+ node_ptr next = NodeTraits::get_next(this_node);
+ return !next || next == this_node;
+ }
 
    //! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
    //!
@@ -107,11 +132,16 @@
    //! <b>Throws</b>: Nothing.
    static node_ptr unlink(node_ptr this_node)
    {
- node_ptr next(NodeTraits::get_next(this_node));
- node_ptr prev(NodeTraits::get_previous(this_node));
- NodeTraits::set_next(prev, next);
- NodeTraits::set_previous(next, prev);
- return next;
+ if(NodeTraits::get_next(this_node)){
+ node_ptr next(NodeTraits::get_next(this_node));
+ node_ptr prev(NodeTraits::get_previous(this_node));
+ NodeTraits::set_next(prev, next);
+ NodeTraits::set_previous(next, prev);
+ return next;
+ }
+ else{
+ return this_node;
+ }
    }
 
    //! <b>Requires</b>: b and e must be nodes of the same circular list or an empty range.
@@ -229,6 +259,17 @@
    public:
    static void swap_nodes(node_ptr this_node, node_ptr other_node)
    {
+ if (other_node == this_node)
+ return;
+ bool this_inited = inited(this_node);
+ bool other_inited = inited(other_node);
+ if(this_inited){
+ init_header(this_node);
+ }
+ if(other_inited){
+ init_header(other_node);
+ }
+
       node_ptr next_this(NodeTraits::get_next(this_node));
       node_ptr prev_this(NodeTraits::get_previous(this_node));
       node_ptr next_other(NodeTraits::get_next(other_node));
@@ -238,6 +279,13 @@
       swap_next(prev_this, prev_other);
       swap_next(this_node, other_node);
       swap_prev(this_node, other_node);
+
+ if(this_inited){
+ init(other_node);
+ }
+ if(other_inited){
+ init(this_node);
+ }
    }
 
    //! <b>Requires</b>: b and e must be nodes of the same circular list or an empty range.
@@ -254,8 +302,8 @@
    {
       if (b != e) {
          node_ptr prev_p(NodeTraits::get_previous(p));
- node_ptr prev_e(NodeTraits::get_previous(e));
          node_ptr prev_b(NodeTraits::get_previous(b));
+ node_ptr prev_e(NodeTraits::get_previous(e));
          NodeTraits::set_next(prev_e, p);
          NodeTraits::set_previous(p, prev_e);
          NodeTraits::set_next(prev_b, e);
@@ -308,6 +356,47 @@
          f = n;
       }
    }
+
+ //! <b>Effects</b>: Moves the node p n positions towards the end of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of moved positions.
+ static void move_backwards(node_ptr p, std::size_t n)
+ {
+ //Null shift, nothing to do
+ if(!n) return;
+ node_ptr first = NodeTraits::get_next(p);
+ //size() == 0 or 1, nothing to do
+ if(first == NodeTraits::get_previous(p)) return;
+ unlink(p);
+ //Now get the new first node
+ while(n--){
+ first = NodeTraits::get_next(first);
+ }
+ link_before(first, p);
+ }
+
+ //! <b>Effects</b>: Moves the node p n positions towards the beginning of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of moved positions.
+ static void move_forward(node_ptr p, std::size_t n)
+ {
+ //Null shift, nothing to do
+ if(!n) return;
+ node_ptr last = NodeTraits::get_previous(p);
+ //size() == 0 or 1, nothing to do
+ if(last == NodeTraits::get_next(p)) return;
+
+ unlink(p);
+ //Now get the new last node
+ while(n--){
+ last = NodeTraits::get_previous(last);
+ }
+ link_after(last, p);
+ }
 };
 
 } //namespace intrusive

Modified: branches/fix-links/boost/intrusive/circular_slist_algorithms.hpp
==============================================================================
--- branches/fix-links/boost/intrusive/circular_slist_algorithms.hpp (original)
+++ branches/fix-links/boost/intrusive/circular_slist_algorithms.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -16,6 +16,7 @@
 
 #include <boost/intrusive/detail/config_begin.hpp>
 #include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/detail/assert.hpp>
 #include <cstddef>
 
 namespace boost {
@@ -25,7 +26,7 @@
 //! forming a circular singly linked list. An empty circular list is formed by a node
 //! whose pointer to the next node points to itself.
 //!
-//! circular_slist_algorithms is configured with a NodeTraits class, which capsulates the
+//! circular_slist_algorithms is configured with a NodeTraits class, which encapsulates the
 //! information about the node to be manipulated. NodeTraits must support the
 //! following interface:
 //!
@@ -72,11 +73,13 @@
    //! <b>Throws</b>: Nothing.
    static node_ptr get_previous_node(node_ptr prev_init_node, node_ptr this_node)
    {
- node_ptr p = prev_init_node;
+ node_ptr p = prev_init_node;
       for( node_ptr p_next
          ; this_node != (p_next = NodeTraits::get_next(p))
          ; p = p_next){
- //empty
+ //Logic error: possible use of linear lists with
+ //operations only permitted with circular lists
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(p);
       }
       return p;
    }
@@ -115,25 +118,46 @@
 
    //! <b>Effects</b>: Constructs an empty list, making this_node the only
    //! node of the circular list:
- //! <tt>NodeTraits::get_next(this_node) == NodeTraits::get_previous(this_node)
- //! == this_node</tt>.
+ //! <tt>NodeTraits::get_next(this_node) == this_node</tt>.
    //!
    //! <b>Complexity</b>: Constant
    //!
    //! <b>Throws</b>: Nothing.
- static void init(node_ptr this_node)
+ static void init_header(node_ptr this_node)
    { NodeTraits::set_next(this_node, this_node); }
 
+ //! <b>Effects</b>: Constructs an non-used list element, putting the next
+ //! pointer to null:
+ //! <tt>NodeTraits::get_next(this_node) == 0
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void init(node_ptr this_node)
+ { NodeTraits::set_next(this_node, 0); }
+
    //! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
    //!
    //! <b>Effects</b>: Returns true is "this_node" is the only node of a circular list:
- //! <tt>return NodeTraits::get_next(this_node) == this_node</tt>
+ //! or it's a not inserted node:
+ //! <tt>return !NodeTraits::get_next(this_node) || NodeTraits::get_next(this_node) == this_node</tt> or
    //!
    //! <b>Complexity</b>: Constant
    //!
    //! <b>Throws</b>: Nothing.
- static bool unique(const_node_ptr this_node)
- { return NodeTraits::get_next(this_node) == this_node; }
+ static bool unique(const_node_ptr this_node)
+ {
+ node_ptr next = NodeTraits::get_next(this_node);
+ return !next || next == this_node;
+ }
+
+ //! <b>Effects</b>: Returns true is "this_node" has the same state as if it was inited using "init(node_ptr)"
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool inited(const_node_ptr this_node)
+ { return !NodeTraits::get_next(this_node); }
 
    //! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
    //!
@@ -165,7 +189,7 @@
    {
       node_ptr this_node(NodeTraits::get_next(prev_node));
       NodeTraits::set_next(prev_node, NodeTraits::get_next(this_node));
- NodeTraits::set_next(this_node, this_node);
+ //NodeTraits::set_next(this_node, this_node);
    }
 
    //! <b>Requires</b>: nxt_node must be in a circular list or be an empty circular list.
@@ -181,7 +205,7 @@
       unlink_after(prev_to_erase);
    }
 
- //! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
+ //! <b>Requires</b>: this_node must be in a circular list, be an empty circular list or be inited.
    //!
    //! <b>Effects</b>: Unlinks the node from the circular list.
    //!
@@ -189,7 +213,10 @@
    //!
    //! <b>Throws</b>: Nothing.
    static void unlink(node_ptr this_node)
- { unlink_after(get_previous_node(this_node)); }
+ {
+ if(NodeTraits::get_next(this_node))
+ unlink_after(get_previous_node(this_node));
+ }
 
    //! <b>Requires</b>: prev_node must be a node of a circular list.
    //!
@@ -200,8 +227,7 @@
    //! <b>Throws</b>: Nothing.
    static void link_after(node_ptr prev_node, node_ptr this_node)
    {
- node_ptr this_nxt = NodeTraits::get_next(prev_node);
- NodeTraits::set_next(this_node, this_nxt);
+ NodeTraits::set_next(this_node, NodeTraits::get_next(prev_node));
       NodeTraits::set_next(prev_node, this_node);
    }
 
@@ -229,6 +255,15 @@
    {
       if (other_node == this_node)
          return;
+ bool this_inited = inited(this_node);
+ bool other_inited = inited(other_node);
+ if(this_inited){
+ init_header(this_node);
+ }
+ if(other_inited){
+ init_header(other_node);
+ }
+
       bool empty1 = unique(this_node);
       bool empty2 = unique(other_node);
       node_ptr prev_this (get_previous_node(this_node));
@@ -240,12 +275,19 @@
       NodeTraits::set_next(other_node, this_next);
       NodeTraits::set_next(empty1 ? other_node : prev_this, other_node);
       NodeTraits::set_next(empty2 ? this_node : prev_other, this_node);
+
+ if(this_inited){
+ init(other_node);
+ }
+ if(other_inited){
+ init(this_node);
+ }
    }
 
    //! <b>Requires</b>: b and e must be nodes of the same circular list or an empty range.
    //! and p must be a node of a different circular list.
    //!
- //! <b>Effects</b>: Removes the nodes from [b, e) range from their circular list and inserts
+ //! <b>Effects</b>: Removes the nodes from (b, e] range from their circular list and inserts
    //! them after p in p's circular list.
    //!
    //! <b>Complexity</b>: Constant
@@ -278,6 +320,99 @@
          transfer_after(e, i, nxt);
       }
    }
+
+ //! <b>Effects</b>: Moves the node p n positions towards the end of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements plus the number moved positions.
+ static void move_backwards(node_ptr p, std::size_t n)
+ {
+ //Null shift, nothing to do
+ if(!n) return;
+ node_ptr first = NodeTraits::get_next(p);
+
+ //count() == 1 or 2, nothing to do
+ if(NodeTraits::get_next(first) == p)
+ return;
+
+ bool end_found = false;
+ node_ptr new_last(0);
+
+ //Now find the new last node according to the shift count.
+ //If we find p before finding the new last node
+ //unlink p, shortcut the search now that we know the size of the list
+ //and continue.
+ for(std::size_t i = 1; i <= n; ++i){
+ new_last = first;
+ first = NodeTraits::get_next(first);
+ if(first == p){
+ //Shortcut the shift with the modulo of the size of the list
+ n %= i;
+ if(!n)
+ return;
+ i = 0;
+ //Unlink p and continue the new first node search
+ first = NodeTraits::get_next(p);
+ unlink_after(new_last);
+ end_found = true;
+ }
+ }
+
+ //If the p has not been found in the previous loop, find it
+ //starting in the new first node and unlink it
+ if(!end_found){
+ unlink_after(get_previous_node(first, p));
+ }
+
+ //Now link p after the new last node
+ link_after(new_last, p);
+ }
+
+ //! <b>Effects</b>: Moves the node p n positions towards the beginning of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements plus the number moved positions.
+ static void move_forward(node_ptr p, std::size_t n)
+ {
+ //Null shift, nothing to do
+ if(!n) return;
+ node_ptr first = node_traits::get_next(p);
+
+ //count() == 1 or 2, nothing to do
+ if(node_traits::get_next(first) == p) return;
+
+ //Iterate until p is found to know where the current last node is.
+ //If the shift count is less than the size of the list, we can also obtain
+ //the position of the new last node after the shift.
+ node_ptr old_last(first), next_to_it, new_last(p);
+ std::size_t distance = 1;
+ while(p != (next_to_it = node_traits::get_next(old_last))){
+ if(++distance > n)
+ new_last = node_traits::get_next(new_last);
+ old_last = next_to_it;
+ }
+ //If the shift was bigger or equal than the size, obtain the equivalent
+ //forward shifts and find the new last node.
+ if(distance <= n){
+ //Now find the equivalent forward shifts.
+ //Shortcut the shift with the modulo of the size of the list
+ std::size_t new_before_last_pos = (distance - (n % distance))% distance;
+ //If the shift is a multiple of the size there is nothing to do
+ if(!new_before_last_pos) return;
+
+ for( new_last = p
+ ; new_before_last_pos--
+ ; new_last = node_traits::get_next(new_last)){
+ //empty
+ }
+ }
+
+ //Now unlink p and link it after the new last node
+ unlink_after(old_last);
+ link_after(new_last, p);
+ }
 };
 
 } //namespace intrusive

Modified: branches/fix-links/boost/intrusive/detail/tree_algorithms.hpp
==============================================================================
--- branches/fix-links/boost/intrusive/detail/tree_algorithms.hpp (original)
+++ branches/fix-links/boost/intrusive/detail/tree_algorithms.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -137,9 +137,9 @@
    { return uncast(header); }
 
    //! <b>Requires</b>: node is a node of the tree or an node initialized
- //! by init(...).
+ //! by init(...) or init_node.
    //!
- //! <b>Effects</b>: Returns true if the node is initialized by init().
+ //! <b>Effects</b>: Returns true if the node is initialized by init() or init_node().
    //!
    //! <b>Complexity</b>: Constant time.
    //!

Modified: branches/fix-links/boost/intrusive/detail/utilities.hpp
==============================================================================
--- branches/fix-links/boost/intrusive/detail/utilities.hpp (original)
+++ branches/fix-links/boost/intrusive/detail/utilities.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -498,8 +498,8 @@
 
 inline float fast_log2 (float val)
 {
- boost::uint32_t * const exp_ptr =
- static_cast <boost::uint32_t * const>(static_cast<void * const >(&val));
+ boost::uint32_t * exp_ptr =
+ static_cast<boost::uint32_t *>(static_cast<void*>(&val));
    boost::uint32_t x = *exp_ptr;
    const int log_2 = (int)(((x >> 23) & 255) - 128);
    x &= ~(255 << 23);

Modified: branches/fix-links/boost/intrusive/intrusive_fwd.hpp
==============================================================================
--- branches/fix-links/boost/intrusive/intrusive_fwd.hpp (original)
+++ branches/fix-links/boost/intrusive/intrusive_fwd.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -69,6 +69,7 @@
    , class O1 = none
    , class O2 = none
    , class O3 = none
+ , class O4 = none
>
 class slist;
 

Modified: branches/fix-links/boost/intrusive/list.hpp
==============================================================================
--- branches/fix-links/boost/intrusive/list.hpp (original)
+++ branches/fix-links/boost/intrusive/list.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -208,7 +208,7 @@
       : data_(v_traits)
    {
       this->priv_size_traits().set_size(size_type(0));
- node_algorithms::init(this->get_root_node());
+ node_algorithms::init_header(this->get_root_node());
    }
 
    //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
@@ -224,7 +224,7 @@
       : data_(v_traits)
    {
       this->priv_size_traits().set_size(size_type(0));
- node_algorithms::init(this->get_root_node());
+ node_algorithms::init_header(this->get_root_node());
       this->insert(this->end(), b, e);
    }
 
@@ -258,7 +258,7 @@
    {
       node_ptr to_insert = get_real_value_traits().to_node_ptr(value);
       if(safemode_or_autounlink)
- BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::inited(to_insert));
       node_algorithms::link_before(this->get_root_node(), to_insert);
       this->priv_size_traits().increment();
    }
@@ -277,7 +277,7 @@
    {
       node_ptr to_insert = get_real_value_traits().to_node_ptr(value);
       if(safemode_or_autounlink)
- BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::inited(to_insert));
       node_algorithms::link_before(node_traits::get_next(this->get_root_node()), to_insert);
       this->priv_size_traits().increment();
    }
@@ -569,21 +569,7 @@
    //!
    //! <b>Note</b>: Does not affect the validity of iterators and references.
    void shift_backwards(size_type n = 1)
- {
- //Null shift, nothing to do
- if(!n) return;
- node_ptr root = this->get_root_node();
- node_ptr last = node_traits::get_previous(root);
- //size() == 0 or 1, nothing to do
- if(last == node_traits::get_next(root)) return;
-
- node_algorithms::unlink(root);
- //Now get the new last node
- while(n--){
- last = node_traits::get_previous(last);
- }
- node_algorithms::link_after(last, root);
- }
+ { node_algorithms::move_forward(this->get_root_node(), n); }
 
    //! <b>Effects</b>: Moves forward all the elements, so that the second
    //! element becomes the first, the third becomes the second...
@@ -595,20 +581,7 @@
    //!
    //! <b>Note</b>: Does not affect the validity of iterators and references.
    void shift_forward(size_type n = 1)
- {
- //Null shift, nothing to do
- if(!n) return;
- node_ptr root = this->get_root_node();
- node_ptr first = node_traits::get_next(root);
- //size() == 0 or 1, nothing to do
- if(first == node_traits::get_previous(root)) return;
- node_algorithms::unlink(root);
- //Now get the new first node
- while(n--){
- first = node_traits::get_next(first);
- }
- node_algorithms::link_before(first, root);
- }
+ { node_algorithms::move_backwards(this->get_root_node(), n); }
 
    //! <b>Effects</b>: Erases the element pointed by i of the list.
    //! No destructors are called.
@@ -729,7 +702,7 @@
          this->erase(this->begin(), this->end());
       }
       else{
- node_algorithms::init(this->get_root_node());
+ node_algorithms::init_header(this->get_root_node());
          this->priv_size_traits().set_size(size_type(0));
       }
    }
@@ -794,7 +767,7 @@
    {
       node_ptr to_insert = get_real_value_traits().to_node_ptr(value);
       if(safemode_or_autounlink)
- BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::inited(to_insert));
       node_algorithms::link_before(p.pointed_node(), to_insert);
       this->priv_size_traits().increment();
       return iterator(to_insert, this);
@@ -1234,7 +1207,7 @@
    static iterator s_iterator_to(reference value)
    {
       BOOST_STATIC_ASSERT((!stateful_value_traits));
- BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::unique(real_value_traits::to_node_ptr(value)));
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(real_value_traits::to_node_ptr(value)));
       return iterator(real_value_traits::to_node_ptr(value), 0);
    }
 
@@ -1252,7 +1225,7 @@
    static const_iterator s_iterator_to(const_reference value)
    {
       BOOST_STATIC_ASSERT((!stateful_value_traits));
- BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::unique(real_value_traits::to_node_ptr(const_cast<reference> (value))));
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(real_value_traits::to_node_ptr(const_cast<reference> (value))));
       return const_iterator(real_value_traits::to_node_ptr(const_cast<reference> (value)), 0);
    }
 
@@ -1267,7 +1240,7 @@
    //! <b>Note</b>: Iterators and references are not invalidated.
    iterator iterator_to(reference value)
    {
- BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::unique(real_value_traits::to_node_ptr(value)));
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(real_value_traits::to_node_ptr(value)));
       return iterator(real_value_traits::to_node_ptr(value), this);
    }
 
@@ -1282,7 +1255,7 @@
    //! <b>Note</b>: Iterators and references are not invalidated.
    const_iterator iterator_to(const_reference value) const
    {
- BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::unique(real_value_traits::to_node_ptr(const_cast<reference> (value))));
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(real_value_traits::to_node_ptr(const_cast<reference> (value))));
       return const_iterator(real_value_traits::to_node_ptr(const_cast<reference> (value)), this);
    }
 

Modified: branches/fix-links/boost/intrusive/options.hpp
==============================================================================
--- branches/fix-links/boost/intrusive/options.hpp (original)
+++ branches/fix-links/boost/intrusive/options.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -318,10 +318,8 @@
 /// @endcond
 };
 
-//!This option setter specifies the type of
-//!a void pointer. This will instruct the hook
-//!to use this type of pointer instead of the
-//!default one
+//!This option setter specifies the link mode
+//!(normal_link, safe_link or auto_unlink)
 template<link_mode_type LinkType>
 struct link_mode
 {
@@ -334,10 +332,8 @@
 /// @endcond
 };
 
-//!This option setter specifies the type of
-//!a void pointer. This will instruct the hook
-//!to use this type of pointer instead of the
-//!default one
+//!This option setter specifies if the hook
+//!should be optimized for size instead of for speed.
 template<bool Enabled>
 struct optimize_size
 {
@@ -350,6 +346,20 @@
 /// @endcond
 };
 
+//!This option setter specifies if the list container should
+//!use a linear implementation instead of a circular one.
+template<bool Enabled>
+struct linear
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ static const bool linear = Enabled;
+ };
+/// @endcond
+};
+
 //!This option setter specifies the bucket traits
 //!class for unordered associative containers. When this option is specified,
 //!instead of using the default bucket traits, a user defined holder will be defined
@@ -475,6 +485,7 @@
       , tag<default_tag>
       , optimize_size<false>
       , store_hash<false>
+ , linear<false>
>::type
 {};
 

Modified: branches/fix-links/boost/intrusive/slist.hpp
==============================================================================
--- branches/fix-links/boost/intrusive/slist.hpp (original)
+++ branches/fix-links/boost/intrusive/slist.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -21,6 +21,7 @@
 #include <boost/intrusive/intrusive_fwd.hpp>
 #include <boost/intrusive/slist_hook.hpp>
 #include <boost/intrusive/circular_slist_algorithms.hpp>
+#include <boost/intrusive/linear_slist_algorithms.hpp>
 #include <boost/intrusive/detail/pointer_to_other.hpp>
 #include <boost/intrusive/link_mode.hpp>
 #include <boost/intrusive/options.hpp>
@@ -46,12 +47,13 @@
 struct get_default_slist_hook
 { typedef typename T::default_slist_hook type; };
 
-template <class ValueTraits, class SizeType, bool ConstantTimeSize>
+template <class ValueTraits, class SizeType, bool ConstantTimeSize, bool Linear>
 struct slistopt
 {
    typedef ValueTraits value_traits;
    typedef SizeType size_type;
    static const bool constant_time_size = ConstantTimeSize;
+ static const bool linear = Linear;
 };
 
 template <class T>
@@ -66,6 +68,7 @@
>::type
>
       , constant_time_size<true>
+ , linear<false>
       , size_type<std::size_t>
>::type
 {};
@@ -129,10 +132,15 @@
       <pointer, node>::type node_ptr;
    typedef typename boost::pointer_to_other
       <pointer, const node>::type const_node_ptr;
- typedef circular_slist_algorithms<node_traits> node_algorithms;
+ typedef typename detail::if_c
+ < Config::linear
+ , linear_slist_algorithms<node_traits>
+ , circular_slist_algorithms<node_traits>
+ >::type node_algorithms;
 
    static const bool constant_time_size = Config::constant_time_size;
    static const bool stateful_value_traits = detail::store_cont_ptr_on_it<slist_impl>::value;
+ static const bool linear = Config::linear;
 
    /// @cond
    private:
@@ -152,6 +160,8 @@
 
    //Constant-time size is incompatible with auto-unlink hooks!
    BOOST_STATIC_ASSERT(!(constant_time_size && ((int)real_value_traits::link_mode == (int)auto_unlink)));
+ //Linear singly linked lists are incompatible with auto-unlink hooks!
+ BOOST_STATIC_ASSERT(!(linear && ((int)real_value_traits::link_mode == (int)auto_unlink)));
 
    node_ptr get_root_node()
    { return node_ptr(&data_.root_plus_size_.root_); }
@@ -220,7 +230,7 @@
       : data_(v_traits)
    {
       this->priv_size_traits().set_size(size_type(0));
- node_algorithms::init(this->get_root_node());
+ node_algorithms::init_header(this->get_root_node());
    }
 
    //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
@@ -236,7 +246,7 @@
       : data_(v_traits)
    {
       this->priv_size_traits().set_size(size_type(0));
- node_algorithms::init(this->get_root_node());
+ node_algorithms::init_header(this->get_root_node());
       insert_after(before_begin(), b, e);
    }
 
@@ -266,7 +276,7 @@
          this->erase_after(this->before_begin(), this->end());
       }
       else{
- node_algorithms::init(this->get_root_node());
+ node_algorithms::init_header(this->get_root_node());
          this->priv_size_traits().set_size(size_type(0));
       }
    }
@@ -299,7 +309,7 @@
    {
       node_ptr to_insert = get_real_value_traits().to_node_ptr(value);
       if(safemode_or_autounlink)
- BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::inited(to_insert));
       node_algorithms::link_after(this->get_root_node(), to_insert);
       this->priv_size_traits().increment();
    }
@@ -385,7 +395,7 @@
    //!
    //! <b>Complexity</b>: Constant.
    iterator end()
- { return iterator (this->get_root_node(), this); }
+ { return iterator (linear ? 0 : this->get_root_node(), this); }
 
    //! <b>Effects</b>: Returns a const_iterator to the end of the list.
    //!
@@ -393,7 +403,7 @@
    //!
    //! <b>Complexity</b>: Constant.
    const_iterator end() const
- { return const_iterator (uncast(this->get_root_node()), this); }
+ { return const_iterator (linear ? 0 : uncast(this->get_root_node()), this); }
 
    //! <b>Effects</b>: Returns a const_iterator to the end of the list.
    //!
@@ -401,7 +411,7 @@
    //!
    //! <b>Complexity</b>: Constant.
    const_iterator cend() const
- { return const_iterator (uncast(this->get_root_node()), this); }
+ { return this->end(); }
 
    //! <b>Effects</b>: Returns an iterator that points to a position
    //! before the first element. Equivalent to "end()"
@@ -410,7 +420,7 @@
    //!
    //! <b>Complexity</b>: Constant.
    iterator before_begin()
- { return end(); }
+ { return iterator(this->get_root_node(), this); }
 
    //! <b>Effects</b>: Returns an iterator that points to a position
    //! before the first element. Equivalent to "end()"
@@ -419,7 +429,7 @@
    //!
    //! <b>Complexity</b>: Constant.
    const_iterator before_begin() const
- { return end(); }
+ { return const_iterator(uncast(this->get_root_node()), this); }
 
    //! <b>Effects</b>: Returns an iterator that points to a position
    //! before the first element. Equivalent to "end()"
@@ -428,7 +438,7 @@
    //!
    //! <b>Complexity</b>: Constant.
    const_iterator cbefore_begin() const
- { return end(); }
+ { return this->before_begin(); }
 
    //! <b>Precondition</b>: end_iterator must be a valid end iterator
    //! of slist.
@@ -487,7 +497,7 @@
    //! <b>Note</b>: Does not affect the validity of iterators and references.
    void swap(slist_impl& other)
    {
- node_algorithms::swap_nodes(this->get_root_node(), other.get_root_node());
+ priv_swap_lists(this->get_root_node(), other.get_root_node(), detail::bool_<linear>());
       if(constant_time_size){
          size_type backup = this->priv_size_traits().get_size();
          this->priv_size_traits().set_size(other.priv_size_traits().get_size());
@@ -506,43 +516,7 @@
    //! <b>Note</b>: Iterators Does not affect the validity of iterators and references.
    void shift_backwards(size_type n = 1)
    {
- //Null shift, nothing to do
- if(!n) return;
- node_ptr root = this->get_root_node();
- node_ptr first = node_traits::get_next(root);
-
- //size() == 0 or 1, nothing to do
- if(node_traits::get_next(first) == root) return;
-
- //Iterate until the root node is found to know where the current last node is.
- //If the shift count is less than the size of the list, we can also obtain
- //the position of the new last node after the shift.
- node_ptr old_last(first), next_to_it, new_last(root);
- size_type distance = 1;
- while(root != (next_to_it = node_traits::get_next(old_last))){
- if(++distance > n)
- new_last = node_traits::get_next(new_last);
- old_last = next_to_it;
- }
- //If the shift was bigger or equal than the size, obtain the equivalent
- //forward shifts and find the new last node.
- if(distance <= n){
- //Now find the equivalent forward shifts.
- //Shorcut the shift with the modulo of the size of the list
- size_type new_before_last_pos = (distance - (n % distance))% distance;
- //If the shift is a multiple of the size there is nothing to do
- if(!new_before_last_pos) return;
-
- for( new_last = root
- ; new_before_last_pos--
- ; new_last = node_traits::get_next(new_last)){
- //empty
- }
- }
-
- //Now unlink the root node and link it after the new last node
- node_algorithms::unlink_after(old_last);
- node_algorithms::link_after(new_last, root);
+ priv_shift_backwards(n, detail::bool_<linear>());
    }
 
    //! <b>Effects</b>: Moves forward all the elements, so that the second
@@ -556,43 +530,7 @@
    //! <b>Note</b>: Does not affect the validity of iterators and references.
    void shift_forward(size_type n = 1)
    {
- //Null shift, nothing to do
- if(!n) return;
- node_ptr root = this->get_root_node();
- node_ptr first = node_traits::get_next(root);
-
- //size() == 0 or 1, nothing to do
- if(node_traits::get_next(first) == root) return;
-
- bool end_found = false;
- node_ptr new_last(0);
-
- //Now find the new last node according to the shift count.
- //If we find the root node before finding the new last node
- //unlink the root, shortcut the search now that we know the size of the list
- //and continue.
- for(size_type i = 1; i <= n; ++i){
- new_last = first;
- first = node_traits::get_next(first);
- if(first == root){
- //Shorcut the shift with the modulo of the size of the list
- n %= i;
- i = 0;
- //Unlink the root node and continue the new first node search
- first = node_traits::get_next(first);
- node_algorithms::unlink_after(new_last);
- end_found = true;
- }
- }
-
- //If the root node has not been found in the previous loop, find it
- //starting in the new first node and unlink it
- if(!end_found){
- node_algorithms::unlink_after(node_algorithms::get_previous_node(first, root));
- }
-
- //Now link the root node after the new last node
- node_algorithms::link_after(new_last, root);
+ priv_shift_forward(n, detail::bool_<linear>());
    }
 
    //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
@@ -643,7 +581,7 @@
    {
       node_ptr n = get_real_value_traits().to_node_ptr(value);
       if(safemode_or_autounlink)
- BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(n));
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::inited(n));
       node_algorithms::link_after(prev_p.pointed_node(), n);
       this->priv_size_traits().increment();
       return iterator (n, this);
@@ -712,16 +650,7 @@
    //! <b>Note</b>: Invalidates the iterators (but not the references) to the
    //! erased element.
    iterator erase_after(iterator prev)
- {
- iterator it(prev); ++it;
- node_ptr to_erase(it.pointed_node());
- node_algorithms::unlink_after(prev.pointed_node());
- this->priv_size_traits().decrement();
- iterator ret(++prev);
- if(safemode_or_autounlink)
- node_algorithms::init(to_erase);
- return ret;
- }
+ { return this->erase_after_and_dispose(prev, detail::null_disposer()); }
 
    //! <b>Effects</b>: Erases the range (before_first, last) from
    //! the list. No destructors are called.
@@ -731,18 +660,12 @@
    //!
    //! <b>Throws</b>: Nothing.
    //!
- //! <b>Complexity</b>: Lineal to the elements (last - before_first).
+ //! <b>Complexity</b>: Lineal to the elements (last - before_first + 1).
    //!
    //! <b>Note</b>: Invalidates the iterators (but not the references) to the
    //! erased element.
    iterator erase_after(iterator before_first, iterator last)
- {
- iterator first;
- while(++(first = before_first) != last){
- this->erase_after(before_first);
- }
- return last;
- }
+ { return this->erase_after_and_dispose(before_first, last, detail::null_disposer()); }
 
    //! <b>Effects</b>: Erases the element pointed by i of the list.
    //! No destructors are called.
@@ -794,11 +717,16 @@
    template<class Disposer>
    iterator erase_after_and_dispose(iterator prev, Disposer disposer)
    {
- iterator it(prev); ++it;
+ iterator it(prev);
+ ++it;
       node_ptr to_erase(it.pointed_node());
- iterator ret(this->erase_after(prev));
+ ++it;
+ node_algorithms::unlink_after(prev.pointed_node());
+ this->priv_size_traits().decrement();
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_erase);
       disposer(get_real_value_traits().to_value_ptr(to_erase));
- return ret;
+ return it;
    }
 
    //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
@@ -818,9 +746,10 @@
    template<class Disposer>
    iterator erase_after_and_dispose(iterator before_first, iterator last, Disposer disposer)
    {
- iterator first;
- while(++(first = before_first) != last){
- this->erase_after_and_dispose(before_first, disposer);
+ iterator next(before_first);
+ ++next;
+ while(next != last){
+ next = this->erase_after_and_dispose(before_first, disposer);
       }
       return last;
    }
@@ -931,7 +860,7 @@
          iterator last_x(x.previous(x.end()));
          node_algorithms::transfer_after
             ( prev.pointed_node()
- , x.end().pointed_node()
+ , x.before_begin().pointed_node()
             , last_x.pointed_node());
          this->priv_size_traits().set_size(this->priv_size_traits().get_size() + x.priv_size_traits().get_size());
          x.priv_size_traits().set_size(size_type(0));
@@ -1133,12 +1062,12 @@
                (last_inserted.pointed_node(), carry.end().pointed_node());
             iterator last_element(p, this);
             if(constant_time_size){
- counter[i].splice_after( counter[i].end(), carry
+ counter[i].splice_after( counter[i].before_begin(), carry
                                       , carry.before_begin(), last_element
                                       , carry.size());
             }
             else{
- counter[i].splice_after( counter[i].end(), carry
+ counter[i].splice_after( counter[i].before_begin(), carry
                                       , carry.before_begin(), last_element);
             }
             if(i == fill)
@@ -1153,11 +1082,11 @@
             (last_inserted.pointed_node(), counter[--fill].end().pointed_node());
          iterator last_element(p, this);
          if(constant_time_size){
- this->splice_after( end(), counter[fill], counter[fill].before_begin()
+ this->splice_after( before_begin(), counter[fill], counter[fill].before_begin()
                               , last_element, counter[fill].size());
          }
          else{
- this->splice_after( end(), counter[fill], counter[fill].before_begin()
+ this->splice_after( before_begin(), counter[fill], counter[fill].before_begin()
                               , last_element);
          }
       }
@@ -1201,14 +1130,14 @@
    template<class Predicate>
    iterator merge(slist_impl& x, Predicate p)
    {
- iterator a(before_begin()), e(end()), ax(x.before_begin());
+ iterator a(before_begin()), e(end()), ax(x.before_begin()), ex(x.end());
       iterator last_inserted(e);
       iterator a_next;
       while(++(a_next = a) != e && !x.empty()) {
          iterator ix(ax);
          iterator cx;
          size_type n(0);
- while(++(cx = ix) != ax && p(*cx, *a_next)){
+ while(++(cx = ix) != ex && p(*cx, *a_next)){
             ++ix; ++n;
          }
          if(ax != ix){
@@ -1235,7 +1164,7 @@
    //!
    //! <b>Note</b>: Iterators and references are not invalidated
    void merge(slist_impl& x)
- { this->merge(x, std::less<value_type>()); }
+ { this->merge(x, std::less<value_type>()); }
 
    //! <b>Effects</b>: Reverses the order of elements in the list.
    //!
@@ -1245,7 +1174,7 @@
    //!
    //! <b>Note</b>: Iterators and references are not invalidated
    void reverse()
- { node_algorithms::reverse(this->get_root_node()); }
+ { priv_reverse(detail::bool_<linear>()); }
 
    //! <b>Effects</b>: Removes all the elements that compare equal to value.
    //! No destructors are called.
@@ -1406,7 +1335,7 @@
    static iterator s_iterator_to(reference value)
    {
       BOOST_STATIC_ASSERT((!stateful_value_traits));
- BOOST_INTRUSIVE_INVARIANT_ASSERT (!node_algorithms::unique(value_traits::to_node_ptr(value)));
+ //BOOST_INTRUSIVE_INVARIANT_ASSERT (!node_algorithms::inited(value_traits::to_node_ptr(value)));
       return iterator (value_traits::to_node_ptr(value), 0);
    }
 
@@ -1424,7 +1353,7 @@
    static const_iterator s_iterator_to(const_reference value)
    {
       BOOST_STATIC_ASSERT((!stateful_value_traits));
- BOOST_INTRUSIVE_INVARIANT_ASSERT (!node_algorithms::unique(value_traits::to_node_ptr(const_cast<reference> (value))));
+ //BOOST_INTRUSIVE_INVARIANT_ASSERT (!node_algorithms::inited(value_traits::to_node_ptr(const_cast<reference> (value))));
       return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), 0);
    }
 
@@ -1439,7 +1368,7 @@
    //! <b>Note</b>: Iterators and references are not invalidated.
    iterator iterator_to(reference value)
    {
- BOOST_INTRUSIVE_INVARIANT_ASSERT (!node_algorithms::unique(value_traits::to_node_ptr(value)));
+ //BOOST_INTRUSIVE_INVARIANT_ASSERT (!node_algorithms::inited(value_traits::to_node_ptr(value)));
       return iterator (value_traits::to_node_ptr(value), this);
    }
 
@@ -1454,7 +1383,7 @@
    //! <b>Note</b>: Iterators and references are not invalidated.
    const_iterator iterator_to(const_reference value) const
    {
- BOOST_INTRUSIVE_INVARIANT_ASSERT (!node_algorithms::unique(value_traits::to_node_ptr(const_cast<reference> (value))));
+ //BOOST_INTRUSIVE_INVARIANT_ASSERT (!node_algorithms::inited(value_traits::to_node_ptr(const_cast<reference> (value))));
       return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), this);
    }
 
@@ -1487,8 +1416,54 @@
    }
 
    private:
+
+ void priv_reverse(detail::bool_<false>)
+ { node_algorithms::reverse(this->get_root_node()); }
+
+ void priv_reverse(detail::bool_<true>)
+ {
+ node_ptr new_first = node_algorithms::reverse
+ (node_traits::get_next(this->get_root_node()));
+ node_traits::set_next(this->get_root_node(), new_first);
+ }
+
+ void priv_shift_backwards(size_type n, detail::bool_<false>)
+ {
+ node_algorithms::move_forward(this->get_root_node(), (std::size_t)n);
+ }
+
+ void priv_shift_backwards(size_type n, detail::bool_<true>)
+ {
+ node_ptr new_first = node_algorithms::move_forward
+ (node_traits::get_next(this->get_root_node()), (std::size_t)n);
+ node_traits::set_next(this->get_root_node(), new_first);
+ }
+
+ void priv_shift_forward(size_type n, detail::bool_<false>)
+ {
+ node_algorithms::move_backwards(this->get_root_node(), (std::size_t)n);
+ }
+
+ void priv_shift_forward(size_type n, detail::bool_<true>)
+ {
+ node_ptr new_first = node_algorithms::move_backwards
+ (node_traits::get_next(this->get_root_node()), (std::size_t)n);
+ node_traits::set_next(this->get_root_node(), new_first);
+ }
+
+ //circular version
+ static void priv_swap_lists(node_ptr this_node, node_ptr other_node, detail::bool_<false>)
+ { node_algorithms::swap_nodes(this_node, other_node); }
+
+ //linear version
+ static void priv_swap_lists(node_ptr this_node, node_ptr other_node, detail::bool_<true>)
+ { node_algorithms::swap_trailing_nodes(this_node, other_node); }
+
    static slist_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
    {
+ //Obtaining the container from the end iterator is not possible with linear
+ //singly linked lists (because "end" is represented by the null pointer)
+ BOOST_STATIC_ASSERT(!linear);
       root_plus_size *r = detail::parent_from_member<root_plus_size, node>
          ( detail::get_pointer(end_iterator.pointed_node()), &root_plus_size::root_);
       data_t *d = detail::parent_from_member<data_t, root_plus_size>
@@ -1620,13 +1595,13 @@
 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
 template<class T, class ...Options>
 #else
-template<class T, class O1 = none, class O2 = none, class O3 = none>
+template<class T, class O1 = none, class O2 = none, class O3 = none, class O4 = none>
 #endif
 struct make_slist
 {
    /// @cond
    typedef typename pack_options
- < slist_defaults<T>, O1, O2, O3>::type packed_options;
+ < slist_defaults<T>, O1, O2, O3, O4>::type packed_options;
    typedef typename detail::get_value_traits
       <T, typename packed_options::value_traits>::type value_traits;
    typedef slist_impl
@@ -1635,6 +1610,7 @@
          < value_traits
          , typename packed_options::size_type
          , packed_options::constant_time_size
+ , packed_options::linear
>
> implementation_defined;
    /// @endcond
@@ -1643,12 +1619,12 @@
 
 
 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
-template<class T, class O1, class O2, class O3>
+template<class T, class O1, class O2, class O3, class O4>
 class slist
- : public make_slist<T, O1, O2, O3>::type
+ : public make_slist<T, O1, O2, O3, O4>::type
 {
    typedef typename make_slist
- <T, O1, O2, O3>::type Base;
+ <T, O1, O2, O3, O4>::type Base;
    typedef typename Base::real_value_traits real_value_traits;
    //Assert if passed value traits are compatible with the type
    BOOST_STATIC_ASSERT((detail::is_same<typename real_value_traits::value_type, T>::value));

Modified: branches/fix-links/boost/intrusive/slist_hook.hpp
==============================================================================
--- branches/fix-links/boost/intrusive/slist_hook.hpp (original)
+++ branches/fix-links/boost/intrusive/slist_hook.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -19,6 +19,7 @@
 #include <boost/intrusive/detail/utilities.hpp>
 #include <boost/intrusive/detail/slist_node.hpp>
 #include <boost/intrusive/circular_slist_algorithms.hpp>
+#include <boost/intrusive/link_mode.hpp>
 #include <boost/intrusive/options.hpp>
 #include <boost/intrusive/detail/generic_hook.hpp>
 
@@ -31,6 +32,7 @@
 {
    typedef circular_slist_algorithms<slist_node_traits<VoidPointer> > type;
 };
+
 /// @endcond
 
 //! Helper metafunction to define a \c slist_base_hook that yields to the same

Modified: branches/fix-links/boost/iostreams/code_converter.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/code_converter.hpp (original)
+++ branches/fix-links/boost/iostreams/code_converter.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -311,10 +311,9 @@
 std::streamsize code_converter<Device, Codevt, Alloc>::read
     (char_type* s, std::streamsize n)
 {
- using namespace std;
     const extern_type* next; // Next external char.
     intern_type* nint; // Next internal char.
- streamsize total = 0; // Characters read.
+ std::streamsize total = 0; // Characters read.
     int status = iostreams::char_traits<char>::good();
     bool partial = false;
     buffer_type& buf = in();
@@ -330,28 +329,28 @@
         }
 
         // Convert.
- codecvt_base::result result =
+ std::codecvt_base::result result =
             cvt().in( buf.state(),
                       buf.ptr(), buf.eptr(), next,
                       s + total, s + n, nint );
         buf.ptr() += next - buf.ptr();
- total = static_cast<streamsize>(nint - s);
+ total = static_cast<std::streamsize>(nint - s);
 
         switch (result) {
- case codecvt_base::partial:
+ case std::codecvt_base::partial:
             partial = true;
             break;
- case codecvt_base::ok:
+ case std::codecvt_base::ok:
             break;
- case codecvt_base::noconv:
+ case std::codecvt_base::noconv:
             {
- streamsize amt =
- std::min<streamsize>(next - buf.ptr(), n - total);
+ std::streamsize amt =
+ std::min<std::streamsize>(next - buf.ptr(), n - total);
                 detail::strncpy_if_same(s + total, buf.ptr(), amt);
                 total += amt;
             }
             break;
- case codecvt_base::error:
+ case std::codecvt_base::error:
         default:
             buf.state() = state_type();
             throw code_conversion_error();
@@ -366,11 +365,10 @@
 std::streamsize code_converter<Device, Codevt, Alloc>::write
     (const char_type* s, std::streamsize n)
 {
- using namespace std;
     buffer_type& buf = out();
     extern_type* next; // Next external char.
     const intern_type* nint; // Next internal char.
- streamsize total = 0; // Characters written.
+ std::streamsize total = 0; // Characters written.
     bool partial = false;
 
     while (total < n) {
@@ -383,7 +381,7 @@
         }
        
         // Convert.
- codecvt_base::result result =
+ std::codecvt_base::result result =
             cvt().out( buf.state(),
                        s + total, s + n, nint,
                        buf.eptr(), buf.end(), next );
@@ -391,21 +389,21 @@
         buf.eptr() += progress;
 
         switch (result) {
- case codecvt_base::partial:
+ case std::codecvt_base::partial:
             partial = true; // Fall through.
- case codecvt_base::ok:
- total = static_cast<streamsize>(nint - s);
+ case std::codecvt_base::ok:
+ total = static_cast<std::streamsize>(nint - s);
             break;
- case codecvt_base::noconv:
+ case std::codecvt_base::noconv:
             {
- streamsize amt =
- std::min<streamsize>( nint - total - s,
- buf.end() - buf.eptr() );
+ std::streamsize amt =
+ std::min<std::streamsize>( nint - total - s,
+ buf.end() - buf.eptr() );
                 detail::strncpy_if_same(buf.eptr(), s + total, amt);
                 total += amt;
             }
             break;
- case codecvt_base::error:
+ case std::codecvt_base::error:
         default:
             buf.state() = state_type();
             throw code_conversion_error();

Modified: branches/fix-links/boost/iostreams/combine.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/combine.hpp (original)
+++ branches/fix-links/boost/iostreams/combine.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -26,6 +26,9 @@
 #include <boost/type_traits/is_convertible.hpp>
 #include <boost/type_traits/is_same.hpp>
 
+// Must come last.
+#include <boost/iostreams/detail/config/disable_warnings.hpp>
+
 namespace boost { namespace iostreams {
 
 namespace detail {
@@ -96,12 +99,22 @@
 
     template<typename Sink>
     void close(Sink& snk, BOOST_IOS::openmode which)
- {
- if (which == BOOST_IOS::in)
+ {
+ if (which == BOOST_IOS::in) {
+ if (is_convertible<in_category, dual_use>::value) {
+ iostreams::close(in_, snk, BOOST_IOS::in);
+ } else {
                 detail::close_all(in_, snk);
- if (which == BOOST_IOS::out)
+ }
+ }
+ if (which == BOOST_IOS::out) {
+ if (is_convertible<out_category, dual_use>::value) {
+ iostreams::close(out_, snk, BOOST_IOS::out);
+ } else {
                 detail::close_all(out_, snk);
+ }
         }
+ }
     #ifndef BOOST_NO_STD_LOCALE
         void imbue(const std::locale& loc);
     #endif
@@ -230,4 +243,6 @@
 
 } } // End namespaces iostreams, boost.
 
+#include <boost/iostreams/detail/config/enable_warnings.hpp>
+
 #endif // #ifndef BOOST_IOSTREAMS_COMBINE_HPP_INCLUDED

Modified: branches/fix-links/boost/iostreams/compose.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/compose.hpp (original)
+++ branches/fix-links/boost/iostreams/compose.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -65,6 +65,8 @@
 class composite_device {
 private:
     typedef typename detail::param_type<Device>::type param_type;
+ typedef typename mode_of<Filter>::type filter_mode;
+ typedef typename mode_of<Device>::type device_mode;
     typedef typename
             iostreams::select< // Disambiguation for Tru64.
                 is_direct<Device>, direct_adapter<Device>,
@@ -120,7 +122,23 @@
               BOOST_DEDUCED_TYPENAME composite_mode<Filter1, Filter2>::type >
 class composite_filter {
 private:
- typedef reference_wrapper<Filter2> filter_ref;
+ typedef reference_wrapper<Filter2> filter_ref;
+ typedef typename mode_of<Filter1>::type first_mode;
+ typedef typename mode_of<Filter2>::type second_mode;
+
+ // A dual-use filter cannot be composed with a read-write filter
+ BOOST_STATIC_ASSERT(
+ !(is_convertible<first_mode, dual_use>::value) ||
+ !(is_convertible<second_mode, input>::value) ||
+ !(is_convertible<second_mode, output>::value) ||
+ (is_convertible<second_mode, dual_use>::value)
+ );
+ BOOST_STATIC_ASSERT(
+ !(is_convertible<second_mode, dual_use>::value) ||
+ !(is_convertible<first_mode, input>::value) ||
+ !(is_convertible<first_mode, output>::value) ||
+ (is_convertible<first_mode, dual_use>::value)
+ );
 public:
     typedef typename char_type_of<Filter1>::type char_type;
     struct category
@@ -170,12 +188,24 @@
 
         // Close input sequences in reverse order and output sequences in
         // forward order
- detail::execute_all(
- detail::call_close(filter2_, dev, BOOST_IOS::in),
- detail::call_close(filter1_, cmp, BOOST_IOS::in),
- detail::call_close(filter1_, cmp, BOOST_IOS::out),
- detail::call_close(filter2_, dev, BOOST_IOS::out)
- );
+ if (!is_convertible<first_mode, dual_use>::value) {
+ detail::execute_all(
+ detail::call_close(filter2_, dev, BOOST_IOS::in),
+ detail::call_close(filter1_, cmp, BOOST_IOS::in),
+ detail::call_close(filter1_, cmp, BOOST_IOS::out),
+ detail::call_close(filter2_, dev, BOOST_IOS::out)
+ );
+ } else if (is_convertible<second_mode, input>::value) {
+ detail::execute_all(
+ detail::call_close(filter2_, dev, BOOST_IOS::in),
+ detail::call_close(filter1_, cmp, BOOST_IOS::in)
+ );
+ } else {
+ detail::execute_all(
+ detail::call_close(filter1_, cmp, BOOST_IOS::out),
+ detail::call_close(filter2_, dev, BOOST_IOS::out)
+ );
+ }
     }
 
     template<typename Device>
@@ -190,18 +220,26 @@
         composite_device<filter_ref, Device> cmp(boost::ref(filter2_), dev);
 
         // Close input sequences in reverse order
- if (which == BOOST_IOS::in)
+ if ( which == BOOST_IOS::in &&
+ ( !is_convertible<first_mode, dual_use>::value ||
+ is_convertible<second_mode, input>::value ) )
+ {
             detail::execute_all(
                 detail::call_close(filter2_, dev, BOOST_IOS::in),
                 detail::call_close(filter1_, cmp, BOOST_IOS::in)
             );
+ }
 
         // Close output sequences in forward order
- if (which == BOOST_IOS::out)
+ if ( which == BOOST_IOS::out &&
+ ( !is_convertible<first_mode, dual_use>::value ||
+ is_convertible<second_mode, output>::value ) )
+ {
             detail::execute_all(
                 detail::call_close(filter1_, cmp, BOOST_IOS::out),
                 detail::call_close(filter2_, dev, BOOST_IOS::out)
             );
+ }
     }
 
     template<typename Device>
@@ -378,33 +416,55 @@
 void composite_device<Filter, Device, Mode>::close()
 {
     BOOST_STATIC_ASSERT((!is_convertible<Mode, two_sequence>::value));
+ BOOST_STATIC_ASSERT(
+ !(is_convertible<filter_mode, dual_use>::value) ||
+ !(is_convertible<device_mode, input>::value) ||
+ !(is_convertible<device_mode, output>::value)
+ );
 
     // Close input sequences in reverse order and output sequences
     // in forward order
- detail::execute_all( detail::call_close(device_, BOOST_IOS::in),
- detail::call_close(filter_, device_, BOOST_IOS::in),
- detail::call_close(filter_, device_, BOOST_IOS::out),
- detail::call_close(device_, BOOST_IOS::out) );
+ if (!is_convertible<filter_mode, dual_use>::value) {
+ detail::execute_all(
+ detail::call_close(device_, BOOST_IOS::in),
+ detail::call_close(filter_, device_, BOOST_IOS::in),
+ detail::call_close(filter_, device_, BOOST_IOS::out),
+ detail::call_close(device_, BOOST_IOS::out)
+ );
+ } else if (is_convertible<device_mode, input>::value) {
+ detail::execute_all(
+ detail::call_close(device_, BOOST_IOS::in),
+ detail::call_close(filter_, device_, BOOST_IOS::in)
+ );
+ } else {
+ detail::execute_all(
+ detail::call_close(filter_, device_, BOOST_IOS::out),
+ detail::call_close(device_, BOOST_IOS::out)
+ );
+ }
 }
 
 template<typename Filter, typename Device, typename Mode>
 void composite_device<Filter, Device, Mode>::close(BOOST_IOS::openmode which)
 {
     BOOST_STATIC_ASSERT((is_convertible<Mode, two_sequence>::value));
+ BOOST_STATIC_ASSERT(!(is_convertible<filter_mode, dual_use>::value));
 
     // Close input sequences in reverse order
- if (which == BOOST_IOS::in)
+ if (which == BOOST_IOS::in) {
         detail::execute_all(
             detail::call_close(device_, BOOST_IOS::in),
             detail::call_close(filter_, device_, BOOST_IOS::in)
         );
+ }
 
     // Close output sequences in forward order
- if (which == BOOST_IOS::out)
+ if (which == BOOST_IOS::out) {
         detail::execute_all(
             detail::call_close(filter_, device_, BOOST_IOS::out),
             detail::call_close(device_, BOOST_IOS::out)
         );
+ }
 }
 
 template<typename Filter, typename Device, typename Mode>

Modified: branches/fix-links/boost/iostreams/copy.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/copy.hpp (original)
+++ branches/fix-links/boost/iostreams/copy.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -56,11 +56,11 @@
 {
     using namespace std;
     typedef typename char_type_of<Source>::type char_type;
- typedef pair<char_type*, char_type*> pair_type;
+ typedef std::pair<char_type*, char_type*> pair_type;
     pair_type p1 = iostreams::input_sequence(src);
     pair_type p2 = iostreams::output_sequence(snk);
- streamsize total =
- static_cast<streamsize>(
+ std::streamsize total =
+ static_cast<std::streamsize>(
             (std::min)(p1.second - p1.first, p2.second - p2.first)
         );
     std::copy(p1.first, p1.first + total, p2.first);
@@ -75,10 +75,10 @@
 {
     using namespace std;
     typedef typename char_type_of<Source>::type char_type;
- typedef pair<char_type*, char_type*> pair_type;
+ typedef std::pair<char_type*, char_type*> pair_type;
     pair_type p = iostreams::input_sequence(src);
     std::streamsize size, total;
- for ( total = 0, size = static_cast<streamsize>(p.second - p.first);
+ for ( total = 0, size = static_cast<std::streamsize>(p.second - p.first);
           total < size; )
     {
         std::streamsize amt =
@@ -94,19 +94,20 @@
                            std::streamsize buffer_size,
                            mpl::false_, mpl::true_ )
 {
- using namespace std;
     typedef typename char_type_of<Source>::type char_type;
- typedef pair<char_type*, char_type*> pair_type;
+ typedef std::pair<char_type*, char_type*> pair_type;
     detail::basic_buffer<char_type> buf(buffer_size);
     pair_type p = snk.output_sequence();
- streamsize total = 0;
- ptrdiff_t capacity = p.second - p.first;
+ std::streamsize total = 0;
+ std::ptrdiff_t capacity = p.second - p.first;
     while (true) {
- streamsize amt =
+ std::streamsize amt =
             iostreams::read(
                 src,
                 buf.data(),
- (std::min)(buffer_size, capacity - total)
+ buffer_size < capacity - total ?
+ buffer_size :
+ static_cast<std::streamsize>(capacity - total)
             );
         if (amt == -1)
             break;

Modified: branches/fix-links/boost/iostreams/detail/adapter/direct_adapter.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/detail/adapter/direct_adapter.hpp (original)
+++ branches/fix-links/boost/iostreams/detail/adapter/direct_adapter.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -42,9 +42,10 @@
 template<typename Direct>
 class direct_adapter_base {
 public:
- typedef typename char_type_of<Direct>::type char_type;
+ typedef typename char_type_of<Direct>::type char_type;
+ typedef typename mode_of<Direct>::type mode_type;
     struct category
- : mode_of<Direct>::type,
+ : mode_type,
           device_tag,
           closable_tag
           #ifndef BOOST_IOSTREAMS_NO_LOCALE
@@ -192,9 +193,9 @@
 {
     using namespace std;
     pointers& get = ptrs_.first();
- streamsize avail =
- static_cast<streamsize>(get.end - get.ptr);
- streamsize result = (std::min)(n, avail);
+ std::streamsize avail =
+ static_cast<std::streamsize>(get.end - get.ptr);
+ std::streamsize result = (std::min)(n, avail);
     std::copy(get.ptr, get.ptr + result, s);
     get.ptr += result;
     return result != 0 ? result : -1;
@@ -206,7 +207,7 @@
 {
     using namespace std;
     pointers& put = ptrs_.second();
- if (n > static_cast<streamsize>(put.end - put.ptr))
+ if (n > static_cast<std::streamsize>(put.end - put.ptr))
         throw write_area_exhausted();
     std::copy(s, s + n, put.ptr);
     put.ptr += n;
@@ -222,7 +223,7 @@
     pointers& get = ptrs_.first();
     pointers& put = ptrs_.second();
     if (way == BOOST_IOS::cur && get.ptr != put.ptr)
- bad_seek();
+ throw bad_seek();
     ptrdiff_t next = 0;
     if ((which & BOOST_IOS::in) || !is_double::value) {
         if (way == BOOST_IOS::beg)
@@ -231,10 +232,10 @@
             next = get.ptr - get.beg + off;
         else
             next = get.end - get.beg + off;
- if (next >= 0 && next < get.end - get.beg)
+ if (next >= 0 && next <= get.end - get.beg)
             get.ptr = get.beg + next;
         else
- bad_seek();
+ throw bad_seek();
     }
     if ((which & BOOST_IOS::out) && is_double::value) {
         if (way == BOOST_IOS::beg)
@@ -243,10 +244,10 @@
             next = put.ptr - put.beg + off;
         else
             next = put.end - put.beg + off;
- if (next >= 0 && next < put.end - put.beg)
+ if (next >= 0 && next <= put.end - put.beg)
             put.ptr = put.beg + next;
         else
- bad_seek();
+ throw bad_seek();
     }
     return offset_to_position(next);
 }

Modified: branches/fix-links/boost/iostreams/detail/adapter/range_adapter.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/detail/adapter/range_adapter.hpp (original)
+++ branches/fix-links/boost/iostreams/detail/adapter/range_adapter.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -155,18 +155,18 @@
         using namespace std;
         switch (way) {
         case BOOST_IOS::beg:
- if (off > last - first || off < 0) bad_seek();
+ if (off > last - first || off < 0) throw bad_seek();
             cur = first + off;
             break;
         case BOOST_IOS::cur:
             {
                 std::ptrdiff_t newoff = cur - first + off;
- if (newoff > last - first || newoff < 0) bad_seek();
+ if (newoff > last - first || newoff < 0) throw bad_seek();
                 cur += off;
                 break;
             }
         case BOOST_IOS::end:
- if (last - first + off < 0 || off > 0) bad_seek();
+ if (last - first + off < 0 || off > 0) throw bad_seek();
             cur = last + off;
             break;
         default:

Modified: branches/fix-links/boost/iostreams/detail/buffer.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/detail/buffer.hpp (original)
+++ branches/fix-links/boost/iostreams/detail/buffer.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -95,11 +95,11 @@
     typename int_type_of<Source>::type fill(Source& src)
     {
         using namespace std;
- streamsize keep;
- if ((keep = static_cast<streamsize>(eptr_ - ptr_)) > 0)
+ std::streamsize keep;
+ if ((keep = static_cast<std::streamsize>(eptr_ - ptr_)) > 0)
             traits_type::move(this->data(), ptr_, keep);
         set(0, keep);
- streamsize result =
+ std::streamsize result =
             iostreams::read(src, this->data() + keep, this->size() - keep);
         if (result != -1)
             this->set(0, keep + result);
@@ -121,8 +121,8 @@
     bool flush(Sink& dest)
     {
         using namespace std;
- streamsize amt = static_cast<std::streamsize>(eptr_ - ptr_);
- streamsize result = iostreams::write_if(dest, ptr_, amt);
+ std::streamsize amt = static_cast<std::streamsize>(eptr_ - ptr_);
+ std::streamsize result = iostreams::write_if(dest, ptr_, amt);
         if (result < amt) {
             traits_type::move( this->data(),
                                ptr_ + result,

Modified: branches/fix-links/boost/iostreams/detail/config/codecvt.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/detail/config/codecvt.hpp (original)
+++ branches/fix-links/boost/iostreams/detail/config/codecvt.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -40,7 +40,10 @@
 
 //------------------Normalize codecvt::length---------------------------------//
 
-#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__)
+#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) && \
+ (!defined(BOOST_RWSTD_VER) || BOOST_RWSTD_VER < 0x04010300) && \
+ (!defined(__MACH__) || !defined(__INTEL_COMPILER))
+ /**/
 # define BOOST_IOSTREAMS_CODECVT_CV_QUALIFIER const
 #else
 # define BOOST_IOSTREAMS_CODECVT_CV_QUALIFIER

Modified: branches/fix-links/boost/iostreams/detail/config/disable_warnings.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/detail/config/disable_warnings.hpp (original)
+++ branches/fix-links/boost/iostreams/detail/config/disable_warnings.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -18,6 +18,7 @@
 #else
 # if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
 # pragma warn -8008 // Condition always true/false.
+# pragma warn -8066 // Unreachable code.
 # pragma warn -8071 // Conversion may lose significant digits.
 # pragma warn -8072 // Suspicious pointer arithmetic.
 # pragma warn -8080 // identifier declared but never used.

Modified: branches/fix-links/boost/iostreams/detail/config/enable_warnings.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/detail/config/enable_warnings.hpp (original)
+++ branches/fix-links/boost/iostreams/detail/config/enable_warnings.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -9,7 +9,9 @@
 #else
 # if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
 # pragma warn .8008 // Condition always true/false.
+# pragma warn .8066 // Unreachable code.
 # pragma warn .8071 // Conversion may lose significant digits.
+# pragma warn .8072 // Suspicious pointer arithmetic.
 # pragma warn .8080 // identifier declared but never used.
 # endif
 #endif

Modified: branches/fix-links/boost/iostreams/detail/execute.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/detail/execute.hpp (original)
+++ branches/fix-links/boost/iostreams/detail/execute.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -18,13 +18,9 @@
  * are thrown. If one of the operations throws an exception, performs the
  * remaining operations and rethrows the initial exception.
  *
- * In order to preserve support for old compilers, no attempt is made to deduce
- * the return type of the primary operation, even though it could be easily
- * deduced in all the intended use cases.
- *
  * execute_foreach() is a variant of std::foreach which invokes a function
  * object for each item in a sequence, catching all execptions and rethrowing
- * the first caucht exception after the function object has been invoked on each
+ * the first caught exception after the function object has been invoked on each
  * item.
  */
 
@@ -35,7 +31,8 @@
 # pragma once
 #endif
 
-#include <boost/config.hpp> // BOOST_NO_RESULT_OF
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
 #include <boost/iostreams/detail/config/limits.hpp> // MAX_EXECUTE_ARITY
 #include <boost/preprocessor/arithmetic/dec.hpp>
 #include <boost/preprocessor/cat.hpp>
@@ -43,9 +40,7 @@
 #include <boost/preprocessor/repetition/enum_params.hpp>
 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
 #include <boost/preprocessor/punctuation/comma_if.hpp>
-#ifndef BOOST_NO_RESULT_OF
-# include <boost/utility/result_of.hpp>
-#endif
+#include <boost/utility/result_of.hpp>
 
 namespace boost { namespace iostreams { namespace detail {
 
@@ -70,11 +65,12 @@
 // returning void and non-void.
 template< typename Op,
           typename Result = // VC6.5 workaround.
- #ifndef BOOST_NO_RESULT_OF
+ #if !defined(BOOST_NO_RESULT_OF) && \
+ !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
                   typename boost::result_of<Op()>::type
               #else
                   BOOST_DEDUCED_TYPENAME Op::result_type
- #endif
+ #endif
>
 struct execute_traits
     : execute_traits_impl<Result>

Modified: branches/fix-links/boost/iostreams/detail/streambuf/direct_streambuf.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/detail/streambuf/direct_streambuf.hpp (original)
+++ branches/fix-links/boost/iostreams/detail/streambuf/direct_streambuf.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -187,10 +187,9 @@
 template<typename T, typename Tr>
 inline typename direct_streambuf<T, Tr>::pos_type
 direct_streambuf<T, Tr>::seekpos
- (pos_type sp, BOOST_IOS::openmode)
+ (pos_type sp, BOOST_IOS::openmode which)
 {
- return seek_impl( position_to_offset(sp), BOOST_IOS::beg,
- BOOST_IOS::in | BOOST_IOS::out );
+ return seek_impl(position_to_offset(sp), BOOST_IOS::beg, which);
 }
 
 template<typename T, typename Tr>

Modified: branches/fix-links/boost/iostreams/detail/streambuf/indirect_streambuf.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/detail/streambuf/indirect_streambuf.hpp (original)
+++ branches/fix-links/boost/iostreams/detail/streambuf/indirect_streambuf.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -7,6 +7,8 @@
 // A. Langer and K. Kreft, "Standard C++ IOStreams and Locales",
 // Addison-Wesley, 2000, pp. 228-43.
 
+// User "GMSB" provided an optimization for small seeks.
+
 #ifndef BOOST_IOSTREAMS_DETAIL_INDIRECT_STREAMBUF_HPP_INCLUDED
 #define BOOST_IOSTREAMS_DETAIL_INDIRECT_STREAMBUF_HPP_INCLUDED
 
@@ -122,7 +124,7 @@
     enum flag_type {
         f_open = 1,
         f_output_buffered = f_open << 1,
- f_auto_close = f_output_buffered << 1,
+ f_auto_close = f_output_buffered << 1
     };
 
     optional<wrapper> storage_;
@@ -165,7 +167,7 @@
     // Construct input buffer.
     if (can_read()) {
         pback_size_ = (std::max)(2, pback_size); // STLPort needs 2.
- streamsize size =
+ std::streamsize size =
             pback_size_ +
             ( buffer_size ? buffer_size: 1 );
         in().resize(size);
@@ -236,8 +238,9 @@
     if (gptr() < egptr()) return traits_type::to_int_type(*gptr());
 
     // Fill putback buffer.
- streamsize keep = (std::min)( static_cast<streamsize>(gptr() - eback()),
- pback_size_ );
+ std::streamsize keep =
+ (std::min)( static_cast<std::streamsize>(gptr() - eback()),
+ pback_size_ );
     if (keep)
         traits_type::move( buf.data() + (pback_size_ - keep),
                            gptr() - keep, keep );
@@ -248,7 +251,7 @@
           buf.data() + pback_size_ );
 
     // Read from source.
- streamsize chars =
+ std::streamsize chars =
         obj().read(buf.data() + pback_size_, buf.size() - pback_size_, next_);
     if (chars == -1) {
         this->set_true_eof(true);
@@ -329,10 +332,9 @@
 template<typename T, typename Tr, typename Alloc, typename Mode>
 inline typename indirect_streambuf<T, Tr, Alloc, Mode>::pos_type
 indirect_streambuf<T, Tr, Alloc, Mode>::seekpos
- (pos_type sp, BOOST_IOS::openmode)
+ (pos_type sp, BOOST_IOS::openmode which)
 {
- return seek_impl( position_to_offset(sp), BOOST_IOS::beg,
- BOOST_IOS::in | BOOST_IOS::out );
+ return seek_impl(position_to_offset(sp), BOOST_IOS::beg, which);
 }
 
 template<typename T, typename Tr, typename Alloc, typename Mode>
@@ -340,6 +342,13 @@
 indirect_streambuf<T, Tr, Alloc, Mode>::seek_impl
     (stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which)
 {
+ if ( gptr() != 0 && way == BOOST_IOS::cur && which == BOOST_IOS::in &&
+ eback() - gptr() <= off && off <= egptr() - gptr() )
+ { // Small seek optimization
+ gbump(off);
+ return obj().seek(0, BOOST_IOS::cur, BOOST_IOS::in, next_) -
+ static_cast<off_type>(egptr() - gptr());
+ }
     if (pptr() != 0)
         this->BOOST_IOSTREAMS_PUBSYNC(); // sync() confuses VisualAge 6.
     if (way == BOOST_IOS::cur && gptr())
@@ -365,7 +374,11 @@
         sync();
         setp(0, 0);
     }
- obj().close(which, next_);
+ if ( !is_convertible<category, dual_use>::value ||
+ is_convertible<Mode, input>::value == (which == BOOST_IOS::in) )
+ {
+ obj().close(which, next_);
+ }
 }
 
 //----------State changing functions------------------------------------------//

Modified: branches/fix-links/boost/iostreams/detail/streambuf/linked_streambuf.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/detail/streambuf/linked_streambuf.hpp (original)
+++ branches/fix-links/boost/iostreams/detail/streambuf/linked_streambuf.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -61,7 +61,7 @@
     template<typename Chain, typename Mode, typename Access>
     friend class chainbuf;
     template<typename U>
- friend struct member_close_operation;
+ friend class member_close_operation;
 #else
     public:
         typedef BOOST_IOSTREAMS_BASIC_STREAMBUF(Ch, Tr) base;

Modified: branches/fix-links/boost/iostreams/device/file_descriptor.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/device/file_descriptor.hpp (original)
+++ branches/fix-links/boost/iostreams/device/file_descriptor.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -32,29 +32,25 @@
 class BOOST_IOSTREAMS_DECL file_descriptor {
 public:
 #ifdef BOOST_IOSTREAMS_WINDOWS
- typedef void* handle_type;
+ typedef void* handle_type; // A.k.a HANDLE
+#else
+ typedef int handle_type;
 #endif
     typedef char char_type;
     struct category
         : seekable_device_tag,
           closable_tag
         { };
- file_descriptor() : pimpl_(new impl) { }
- explicit file_descriptor(int fd, bool close_on_exit = false)
- : pimpl_(new impl(fd, close_on_exit))
- { }
+ file_descriptor();
+ explicit file_descriptor(handle_type fd, bool close_on_exit = false);
 #ifdef BOOST_IOSTREAMS_WINDOWS
- explicit file_descriptor(handle_type handle, bool close_on_exit = false)
- : pimpl_(new impl(handle, close_on_exit))
- { }
+ explicit file_descriptor(int fd, bool close_on_exit = false);
 #endif
     explicit file_descriptor( const std::string& path,
                               BOOST_IOS::openmode mode =
                                   BOOST_IOS::in | BOOST_IOS::out,
                               BOOST_IOS::openmode base_mode =
- BOOST_IOS::in | BOOST_IOS::out )
- : pimpl_(new impl)
- { open(path, mode, base_mode); }
+ BOOST_IOS::in | BOOST_IOS::out );
     void open( const std::string& path,
                BOOST_IOS::openmode =
                    BOOST_IOS::in | BOOST_IOS::out,
@@ -65,41 +61,44 @@
     std::streamsize write(const char_type* s, std::streamsize n);
     std::streampos seek(stream_offset off, BOOST_IOS::seekdir way);
     void close();
+ handle_type handle() const { return pimpl_->handle_; }
 private:
     struct impl {
- impl() : fd_(-1), flags_(0) { }
- impl(int fd, bool close_on_exit)
- : fd_(fd), flags_(0)
- { if (close_on_exit) flags_ |= impl::close_on_exit; }
- #ifdef BOOST_IOSTREAMS_WINDOWS
- impl(handle_type handle, bool close_on_exit)
- : handle_(handle), flags_(has_handle)
+ impl() :
+ #ifdef BOOST_IOSTREAMS_WINDOWS
+ handle_(reinterpret_cast<handle_type>(-1)),
+ #else
+ handle_(-1),
+ #endif
+ flags_(0)
+ { }
+ impl(handle_type fd, bool close_on_exit)
+ : handle_(fd), flags_(0)
         { if (close_on_exit) flags_ |= impl::close_on_exit; }
- #endif
- ~impl() {
- if (flags_ & close_on_exit) close_impl(*this);
- }
+ ~impl()
+ { if (flags_ & close_on_exit) close_impl(*this); }
         enum flags {
             close_on_exit = 1,
- has_handle = 2,
             append = 4
         };
- int fd_;
- #ifdef BOOST_IOSTREAMS_WINDOWS
         handle_type handle_;
- #endif
         int flags_;
     };
     friend struct impl;
 
     static void close_impl(impl&);
+#ifdef BOOST_IOSTREAMS_WINDOWS
+ static handle_type int_to_handle(int fd);
+#endif
 
     shared_ptr<impl> pimpl_;
 };
 
 struct file_descriptor_source : private file_descriptor {
 #ifdef BOOST_IOSTREAMS_WINDOWS
- typedef void* handle_type;
+ typedef void* handle_type; // A.k.a HANDLE
+#else
+ typedef int handle_type;
 #endif
     typedef char char_type;
     struct category
@@ -112,14 +111,14 @@
     using file_descriptor::open;
     using file_descriptor::is_open;
     using file_descriptor::close;
+ using file_descriptor::handle;
     file_descriptor_source() { }
- explicit file_descriptor_source(int fd, bool close_on_exit = false)
+ explicit file_descriptor_source(handle_type fd, bool close_on_exit = false)
         : file_descriptor(fd, close_on_exit)
         { }
 #ifdef BOOST_IOSTREAMS_WINDOWS
- explicit file_descriptor_source( handle_type handle,
- bool close_on_exit = false )
- : file_descriptor(handle, close_on_exit)
+ explicit file_descriptor_source(int fd, bool close_on_exit = false)
+ : file_descriptor(fd, close_on_exit)
         { }
 #endif
     explicit file_descriptor_source( const std::string& path,
@@ -130,7 +129,9 @@
 
 struct file_descriptor_sink : private file_descriptor {
 #ifdef BOOST_IOSTREAMS_WINDOWS
- typedef void* handle_type;
+ typedef void* handle_type; // A.k.a HANDLE
+#else
+ typedef int handle_type;
 #endif
     typedef char char_type;
     struct category
@@ -143,14 +144,14 @@
     using file_descriptor::open;
     using file_descriptor::is_open;
     using file_descriptor::close;
+ using file_descriptor::handle;
     file_descriptor_sink() { }
- explicit file_descriptor_sink(int fd, bool close_on_exit = false)
+ explicit file_descriptor_sink(handle_type fd, bool close_on_exit = false)
         : file_descriptor(fd, close_on_exit)
         { }
 #ifdef BOOST_IOSTREAMS_WINDOWS
- explicit file_descriptor_sink( handle_type handle,
- bool close_on_exit = false )
- : file_descriptor(handle, close_on_exit)
+ explicit file_descriptor_sink(int fd, bool close_on_exit = false)
+ : file_descriptor(fd, close_on_exit)
         { }
 #endif
     explicit file_descriptor_sink( const std::string& path,

Modified: branches/fix-links/boost/iostreams/device/mapped_file.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/device/mapped_file.hpp (original)
+++ branches/fix-links/boost/iostreams/device/mapped_file.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -62,7 +62,9 @@
 
 struct mapped_file_params {
     explicit mapped_file_params()
- #if BOOST_WORKAROUND(BOOST_MSVC, < 1400) && defined(BOOST_RWSTD_VER)
+ #if BOOST_WORKAROUND(BOOST_MSVC, < 1400) && defined(BOOST_RWSTD_VER) || \
+ defined(__BORLANDC__) && defined(_CPPLIB_VER)
+ /**/
         : mode(std::ios_base::openmode(0)),
     #else
         : mode(),
@@ -72,7 +74,8 @@
         { }
     explicit mapped_file_params(const std::string& path)
         : path(path),
- #if BOOST_WORKAROUND(BOOST_MSVC, < 1400) && defined(BOOST_RWSTD_VER)
+ #if BOOST_WORKAROUND(BOOST_MSVC, < 1400) && defined(BOOST_RWSTD_VER) || \
+ defined(__BORLANDC__) && defined(_CPPLIB_VER)
           mode(std::ios_base::openmode(0)),
     #else
           mode(),
@@ -221,6 +224,7 @@
           public closable_tag
         { };
     using mapped_file::close;
+ using mapped_file::size;
     explicit mapped_file_sink(mapped_file_params p);
     explicit mapped_file_sink( const std::string& path,
                                size_type length = max_length,

Modified: branches/fix-links/boost/iostreams/filter/aggregate.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/filter/aggregate.hpp (original)
+++ branches/fix-links/boost/iostreams/filter/aggregate.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -15,10 +15,13 @@
 #include <cassert>
 #include <iterator> // back_inserter
 #include <vector>
+#include <boost/iostreams/constants.hpp> // default_device_buffer_size
 #include <boost/iostreams/categories.hpp>
 #include <boost/iostreams/detail/char_traits.hpp>
 #include <boost/iostreams/detail/ios.hpp> // openmode, streamsize.
 #include <boost/iostreams/pipeline.hpp>
+#include <boost/iostreams/read.hpp> // check_eof
+#include <boost/iostreams/write.hpp>
 #include <boost/mpl/bool.hpp>
 #include <boost/type_traits/is_convertible.hpp>
 
@@ -58,8 +61,8 @@
         state_ |= f_read;
         if (!(state_ & f_eof))
             do_read(src);
- streamsize amt =
- (std::min)(n, static_cast<streamsize>(data_.size() - ptr_));
+ std::streamsize amt =
+ (std::min)(n, static_cast<std::streamsize>(data_.size() - ptr_));
         if (amt) {
             BOOST_IOSTREAMS_CHAR_TRAITS(char_type)::copy(s, &data_[ptr_], amt);
             ptr_ += amt;
@@ -110,9 +113,9 @@
         using std::streamsize;
         vector_type data;
         while (true) {
- const streamsize size = default_device_buffer_size;
- Ch buf[size];
- streamsize amt;
+ const std::streamsize size = default_device_buffer_size;
+ Ch buf[size];
+ std::streamsize amt;
             if ((amt = boost::iostreams::read(src, buf, size)) == -1)
                 break;
             data.insert(data.end(), buf, buf + amt);

Modified: branches/fix-links/boost/iostreams/filter/gzip.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/filter/gzip.hpp (original)
+++ branches/fix-links/boost/iostreams/filter/gzip.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -134,7 +134,7 @@
                  std::string comment = "",
                  std::time_t mtime = 0 )
         : zlib_params(level, method, window_bits, mem_level, strategy),
- file_name(file_name), mtime(mtime)
+ file_name(file_name), comment(comment), mtime(mtime)
         { }
     std::string file_name;
     std::string comment;
@@ -185,8 +185,7 @@
     template<typename Source>
     std::streamsize read(Source& src, char_type* s, std::streamsize n)
     {
- using namespace std;
- streamsize result = 0;
+ std::streamsize result = 0;
 
         // Read header.
         if (!(flags_ & f_header_done))
@@ -196,7 +195,7 @@
         if (!(flags_ & f_body_done)) {
 
             // Read from basic_zlib_filter.
- streamsize amt = base_type::read(src, s + result, n - result);
+ std::streamsize amt = base_type::read(src, s + result, n - result);
             if (amt != -1) {
                 result += amt;
                 if (amt < n - result) { // Double-check for EOF.
@@ -252,6 +251,8 @@
                 throw;
             }
             close_impl();
+ } else {
+ close_impl();
         }
     }
 private:
@@ -557,10 +558,9 @@
 std::streamsize basic_gzip_compressor<Alloc>::read_string
     (char* s, std::streamsize n, std::string& str)
 {
- using namespace std;
- streamsize avail =
- static_cast<streamsize>(str.size() - offset_);
- streamsize amt = (std::min)(avail, n);
+ std::streamsize avail =
+ static_cast<std::streamsize>(str.size() - offset_);
+ std::streamsize amt = (std::min)(avail, n);
     std::copy( str.data() + offset_,
                str.data() + offset_ + amt,
                s );

Modified: branches/fix-links/boost/iostreams/filter/line.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/filter/line.hpp (original)
+++ branches/fix-links/boost/iostreams/filter/line.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -18,7 +18,9 @@
 #include <boost/config.hpp> // BOOST_STATIC_CONSTANT.
 #include <boost/iostreams/categories.hpp>
 #include <boost/iostreams/detail/ios.hpp> // openmode, streamsize.
+#include <boost/iostreams/read.hpp> // check_eof
 #include <boost/iostreams/pipeline.hpp>
+#include <boost/iostreams/write.hpp>
 
 // Must come last.
 #include <boost/iostreams/detail/config/disable_warnings.hpp> // VC7.1 C4244.
@@ -70,7 +72,7 @@
         state_ |= f_read;
 
         // Handle unfinished business.
- streamsize result = 0;
+ std::streamsize result = 0;
         if (!cur_line_.empty() && (result = read_line(s, n)) == n)
             return n;
 
@@ -143,8 +145,8 @@
     std::streamsize read_line(char_type* s, std::streamsize n)
     {
         using namespace std;
- streamsize result =
- (std::min) (n, static_cast<streamsize>(cur_line_.size()));
+ std::streamsize result =
+ (std::min) (n, static_cast<std::streamsize>(cur_line_.size()));
         traits_type::copy(s, cur_line_.data(), result);
         cur_line_.erase(0, result);
         return result;

Modified: branches/fix-links/boost/iostreams/filter/newline.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/filter/newline.hpp (original)
+++ branches/fix-links/boost/iostreams/filter/newline.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -19,8 +19,12 @@
 #include <stdexcept> // logic_error.
 #include <boost/config.hpp> // BOOST_STATIC_CONSTANT.
 #include <boost/iostreams/categories.hpp>
-#include <boost/iostreams/detail/char_traits.hpp>
+#include <boost/iostreams/detail/char_traits.hpp>
+#include <boost/iostreams/detail/ios.hpp> // BOOST_IOSTREAMS_FAILURE
+#include <boost/iostreams/read.hpp> // get
+#include <boost/iostreams/write.hpp> // put
 #include <boost/iostreams/pipeline.hpp>
+#include <boost/iostreams/putback.hpp>
 #include <boost/mpl/bool.hpp>
 #include <boost/type_traits/is_convertible.hpp>
 
@@ -211,8 +215,7 @@
         typedef typename iostreams::category_of<Sink>::type category;
         if ((flags_ & f_write) != 0 && (flags_ & f_has_CR) != 0)
             newline_if_sink(dest);
- if (which == BOOST_IOS::out)
- flags_ &= newline::platform_mask;
+ flags_ &= ~f_has_LF; // Restore original flags.
     }
 private:
 
@@ -398,24 +401,21 @@
     {
         using iostreams::newline::final_newline;
 
- if (which == BOOST_IOS::out) {
-
- // Update final_newline flag.
- if ( (source() & f_has_CR) != 0 ||
- (source() & f_line_complete) != 0 )
- {
- source() |= final_newline;
- }
+ // Update final_newline flag.
+ if ( (source() & f_has_CR) != 0 ||
+ (source() & f_line_complete) != 0 )
+ {
+ source() |= final_newline;
+ }
 
- // Clear non-sticky flags.
- source() &= ~(f_has_CR | f_line_complete);
+ // Clear non-sticky flags.
+ source() &= ~(f_has_CR | f_line_complete);
 
- // Check for errors.
- if ( (target_ & final_newline) != 0 &&
- (source() & final_newline) == 0 )
- {
- fail();
- }
+ // Check for errors.
+ if ( (target_ & final_newline) != 0 &&
+ (source() & final_newline) == 0 )
+ {
+ fail();
         }
     }
 private:

Modified: branches/fix-links/boost/iostreams/filter/symmetric.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/filter/symmetric.hpp (original)
+++ branches/fix-links/boost/iostreams/filter/symmetric.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -115,7 +115,9 @@
                     !filter().filter(next, buf.eptr(), next_s, end_s, flush);
                 buf.ptr() = buf.data() + (next - buf.data());
                 if (done)
- return detail::check_eof(static_cast<streamsize>(next_s - s));
+ return detail::check_eof(
+ static_cast<std::streamsize>(next_s - s)
+ );
             }
 
             // If no more characters are available without blocking, or
@@ -123,7 +125,7 @@
             if ( status == f_would_block && buf.ptr() == buf.eptr() ||
                  next_s == end_s )
             {
- return static_cast<streamsize>(next_s - s);
+ return static_cast<std::streamsize>(next_s - s);
             }
 
             // Fill buffer.
@@ -151,10 +153,7 @@
     template<typename Sink>
     void close(Sink& snk, BOOST_IOS::openmode which)
     {
- using namespace std;
- if ((state() & f_write) == 0 && which == BOOST_IOS::in)
- close_impl();
- if ((state() & f_write) != 0 && which == BOOST_IOS::out) {
+ if ((state() & f_write) != 0) {
 
             // Repeatedly invoke filter() with no input.
             try {
@@ -173,6 +172,8 @@
                 throw;
             }
             close_impl();
+ } else {
+ close_impl();
         }
     }
     SymmetricFilter& filter() { return *pimpl_; }
@@ -215,11 +216,10 @@
     template<typename Sink>
     bool flush(Sink& snk, mpl::true_)
     {
- using std::streamsize;
         typedef char_traits<char_type> traits_type;
- streamsize amt =
- static_cast<streamsize>(buf().ptr() - buf().data());
- streamsize result =
+ std::streamsize amt =
+ static_cast<std::streamsize>(buf().ptr() - buf().data());
+ std::streamsize result =
             boost::iostreams::write(snk, buf().data(), amt);
         if (result < amt && result > 0)
             traits_type::move(buf().data(), buf().data() + result, amt - result);

Modified: branches/fix-links/boost/iostreams/input_sequence.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/input_sequence.hpp (original)
+++ branches/fix-links/boost/iostreams/input_sequence.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -15,6 +15,7 @@
 #include <boost/config.hpp> // DEDUCED_TYPENAME, MSVC.
 #include <boost/detail/workaround.hpp>
 #include <boost/iostreams/detail/wrap_unwrap.hpp>
+#include <boost/iostreams/operations_fwd.hpp> // is_custom
 #include <boost/iostreams/traits.hpp>
 #include <boost/mpl/if.hpp>
 

Modified: branches/fix-links/boost/iostreams/invert.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/invert.hpp (original)
+++ branches/fix-links/boost/iostreams/invert.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -36,8 +36,9 @@
 //
 // Template name: inverse.
 // Template paramters:
-// Filter - A filter adapter which
-// Description: Returns an instance of an appropriate specialization of inverse.
+// Filter - A model of InputFilter or OutputFilter.
+// Description: Generates an InputFilter from an OutputFilter or
+// vice versa.
 //
 template<typename Filter>
 class inverse {

Modified: branches/fix-links/boost/iostreams/output_sequence.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/output_sequence.hpp (original)
+++ branches/fix-links/boost/iostreams/output_sequence.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -15,6 +15,7 @@
 #include <boost/config.hpp> // DEDUCED_TYPENAME, MSVC.
 #include <boost/detail/workaround.hpp>
 #include <boost/iostreams/detail/wrap_unwrap.hpp>
+#include <boost/iostreams/operations_fwd.hpp> // is_custom
 #include <boost/iostreams/traits.hpp>
 #include <boost/mpl/if.hpp>
 

Modified: branches/fix-links/boost/iostreams/positioning.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/positioning.hpp (original)
+++ branches/fix-links/boost/iostreams/positioning.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -18,6 +18,7 @@
 #include <boost/cstdint.hpp>
 #include <boost/integer_traits.hpp>
 #include <boost/iostreams/detail/config/codecvt.hpp> // mbstate_t.
+#include <boost/iostreams/detail/config/fpos.hpp>
 #include <boost/iostreams/detail/ios.hpp> // streamoff, streampos.
 
 // Must come last.
@@ -28,72 +29,83 @@
 #endif
 
 namespace boost { namespace iostreams {
+
+//------------------Definition of stream_offset-------------------------------//
 
 typedef boost::intmax_t stream_offset;
 
+//------------------Definition of stream_offset_to_streamoff------------------//
+
 inline std::streamoff stream_offset_to_streamoff(stream_offset off)
 { return static_cast<stream_offset>(off); }
 
-template<typename PosType> // Hande custom pos_type's.
+//------------------Definition of offset_to_position--------------------------//
+
+# ifndef BOOST_IOSTREAMS_HAS_DINKUMWARE_FPOS
+
+inline std::streampos offset_to_position(stream_offset off) { return off; }
+
+# else // # ifndef BOOST_IOSTREAMS_HAS_DINKUMWARE_FPOS
+
+inline std::streampos offset_to_position(stream_offset off)
+{ return std::streampos(std::mbstate_t(), off); }
+
+# endif // # ifndef BOOST_IOSTREAMS_HAS_DINKUMWARE_FPOS
+
+//------------------Definition of position_to_offset--------------------------//
+
+// Hande custom pos_type's
+template<typename PosType>
 inline stream_offset position_to_offset(PosType pos)
 { return std::streamoff(pos); }
 
-#if ((defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)) && \
- !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) \
- && !defined(__QNX__) \
- /**/
+# ifndef BOOST_IOSTREAMS_HAS_DINKUMWARE_FPOS
 
- /* Dinkumware */
+inline stream_offset position_to_offset(std::streampos pos) { return pos; }
 
-inline std::streampos offset_to_position(stream_offset off)
-{
- // Use implementation-specific constructor.
- return std::streampos(std::mbstate_t(), off);
-}
+# else // # ifndef BOOST_IOSTREAMS_HAS_DINKUMWARE_FPOS
 
+// In the Dinkumware standard library, a std::streampos consists of two stream
+// offsets -- _Fpos, of type std::fpos_t, and _Myoff, of type std::streamoff --
+// together with a conversion state. A std::streampos is converted to a
+// boost::iostreams::stream_offset by extracting the two stream offsets and
+// summing them. The value of _Fpos can be extracted using the implementation-
+// defined member functions seekpos() or get_fpos_t(), depending on the
+// Dinkumware version. The value of _Myoff cannot be extracted directly, but can
+// be calculated as the difference between the result of converting the
+// std::fpos to a std::streamoff and the result of converting the member _Fpos
+// to a long. The latter operation is accomplished with the macro _FPOSOFF,
+// which works correctly on platforms where std::fpos_t is an integral type and
+// platforms where it is a struct
+
+// Converts a std::fpos_t to a stream_offset
 inline stream_offset fpos_t_to_offset(std::fpos_t pos)
-{ // Helper function.
-#if defined(_POSIX_) || (_INTEGRAL_MAX_BITS >= 64)
+{
+# if defined(_POSIX_) || (_INTEGRAL_MAX_BITS >= 64) || defined(__IBMCPP__)
     return pos;
-#else
+# else
     return _FPOSOFF(pos);
-#endif
+# endif
 }
 
-# if defined(_CPPLIB_VER) //--------------------------------------------------//
-
- /* Recent Dinkumware */
-
-inline stream_offset position_to_offset(std::streampos pos)
+// Extracts the member _Fpos from a std::fpos
+inline std::fpos_t streampos_to_fpos_t(std::streampos pos)
 {
- // Use implementation-specific member function seekpos().
- return fpos_t_to_offset(pos.seekpos()) +
- stream_offset(std::streamoff(pos)) -
- stream_offset(std::streamoff(pos.seekpos()));
+# if defined (_CPPLIB_VER) || defined(__IBMCPP__)
+ return pos.seekpos();
+# else
+ return pos.get_fpos_t();
+# endif
 }
 
-# else // # if defined(_CPPLIB_VER) //----------------------------------------//
-
- /* Old Dinkumware */
-
 inline stream_offset position_to_offset(std::streampos pos)
 {
- // use implementation-specific member function get_fpos_t().
- return fpos_t_to_offset(pos.get_fpos_t()) +
- stream_offset(std::streamoff(pos)) -
- stream_offset(std::streamoff(pos.get_fpos_t()));
+ return fpos_t_to_offset(streampos_to_fpos_t(pos)) +
+ static_cast<stream_offset>(static_cast<std::streamoff>(pos)) -
+ static_cast<stream_offset>(_FPOSOFF(streampos_to_fpos_t(pos)));
 }
 
-# endif // # if defined(_CPPLIB_VER) //---------------------------------------//
-#else // Dinkumware //--------------------------------------------------------//
-
- /* Non-Dinkumware */
-
-inline std::streampos offset_to_position(stream_offset off) { return off; }
-
-inline stream_offset position_to_offset(std::streampos pos) { return pos; }
-
-#endif // Dinkumware //-------------------------------------------------------//
+# endif // # ifndef BOOST_IOSTREAMS_HAS_DINKUMWARE_FPOS
 
 } } // End namespaces iostreams, boost.
 

Modified: branches/fix-links/boost/iostreams/restrict.hpp
==============================================================================
--- branches/fix-links/boost/iostreams/restrict.hpp (original)
+++ branches/fix-links/boost/iostreams/restrict.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,442 +1,24 @@
-// (C) Copyright Jonathan Turkanis 2005.
-// 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.)
-
-// See http://www.boost.org/libs/iostreams for documentation.
+/*
+ * 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.)
+ *
+ * See http://www.boost.org/libs/iostreams for documentation.
+ *
+ * File: boost/iostreams/detail/restrict.hpp
+ * Date: Sun Jan 06 12:57:30 MST 2008
+ * Copyright: 2004-2007 Jonathan Turkanis
+ * Author: Jonathan Turkanis
+ *
+ * Defines the class template boost::iostreams::restriction and the
+ * overloaded function template boost::iostreams::restrict
+ */
 
 #ifndef BOOST_IOSTREAMS_RESTRICT_HPP_INCLUDED
 #define BOOST_IOSTREAMS_RESTRICT_HPP_INCLUDED
 
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#endif
-
-#include <algorithm> // min.
-#include <utility> // pair.
-#include <boost/cstdint.hpp> // intmax_t.
-#include <boost/config.hpp> // DEDUCED_TYPENAME.
-#include <boost/iostreams/categories.hpp>
-#include <boost/iostreams/char_traits.hpp>
-#include <boost/iostreams/detail/adapter/device_adapter.hpp>
-#include <boost/iostreams/detail/adapter/filter_adapter.hpp>
-#include <boost/iostreams/detail/call_traits.hpp>
-#include <boost/iostreams/detail/enable_if_stream.hpp>
-#include <boost/iostreams/detail/error.hpp>
-#include <boost/iostreams/detail/ios.hpp> // failure.
-#include <boost/iostreams/detail/select.hpp>
-#include <boost/iostreams/operations.hpp>
-#include <boost/iostreams/skip.hpp>
-#include <boost/iostreams/traits.hpp> // mode_of, is_direct.
-#include <boost/mpl/bool.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/type_traits/is_convertible.hpp>
-
-#include <boost/iostreams/detail/config/disable_warnings.hpp>
-
-namespace boost { namespace iostreams {
-
-namespace detail {
-
-//
-// Template name: restricted_indirect_device.
-// Description: Provides an restricted view of an indirect Device.
-// Template paramters:
-// Device - An indirect model of Device that models either Source or
-// SeekableDevice.
-//
-template<typename Device>
-class restricted_indirect_device : public device_adapter<Device> {
-private:
- typedef typename detail::param_type<Device>::type param_type;
-public:
- typedef typename char_type_of<Device>::type char_type;
- typedef typename mode_of<Device>::type mode;
- BOOST_STATIC_ASSERT(!(is_convertible<mode, detail::two_sequence>::value));
- struct category
- : mode,
- device_tag,
- closable_tag,
- flushable_tag,
- localizable_tag,
- optimally_buffered_tag
- { };
- restricted_indirect_device( param_type dev, stream_offset off,
- stream_offset len = -1 );
- std::streamsize read(char_type* s, std::streamsize n);
- std::streamsize write(const char_type* s, std::streamsize n);
- std::streampos seek(stream_offset off, BOOST_IOS::seekdir way);
-private:
- stream_offset beg_, pos_, end_;
-};
-
-//
-// Template name: restricted_direct_device.
-// Description: Provides an restricted view of a Direct Device.
-// Template paramters:
-// Device - A model of Direct and Device.
-//
-template<typename Device>
-class restricted_direct_device : public device_adapter<Device> {
-public:
- typedef typename char_type_of<Device>::type char_type;
- typedef std::pair<char_type*, char_type*> pair_type;
- typedef typename mode_of<Device>::type mode;
- BOOST_STATIC_ASSERT(!(is_convertible<mode, detail::two_sequence>::value));
- struct category
- : mode_of<Device>::type,
- device_tag,
- direct_tag,
- closable_tag,
- localizable_tag
- { };
- restricted_direct_device( const Device& dev, stream_offset off,
- stream_offset len = -1 );
- pair_type input_sequence();
- pair_type output_sequence();
-private:
- pair_type sequence(mpl::true_);
- pair_type sequence(mpl::false_);
- char_type *beg_, *end_;
-};
-
-//
-// Template name: restricted_filter.
-// Description: Provides an restricted view of a Filter.
-// Template paramters:
-// Filter - An indirect model of Filter.
-//
-template<typename Filter>
-class restricted_filter : public filter_adapter<Filter> {
-public:
- typedef typename char_type_of<Filter>::type char_type;
- typedef typename mode_of<Filter>::type mode;
- BOOST_STATIC_ASSERT(!(is_convertible<mode, detail::two_sequence>::value));
- struct category
- : mode,
- filter_tag,
- multichar_tag,
- closable_tag,
- localizable_tag,
- optimally_buffered_tag
- { };
- restricted_filter( const Filter& flt, stream_offset off,
- stream_offset len = -1 );
-
- template<typename Source>
- std::streamsize read(Source& src, char_type* s, std::streamsize n)
- {
- using namespace std;
- if (!open_)
- open(src, BOOST_IOS::in);
- streamsize amt =
- end_ != -1 ?
- (std::min) (n, static_cast<streamsize>(end_ - pos_)) :
- n;
- streamsize result = iostreams::read(this->component(), src, s, amt);
- if (result != -1)
- pos_ += result;
- return result;
- }
-
- template<typename Sink>
- std::streamsize write(Sink& snk, const char_type* s, std::streamsize n)
- {
- if (!open_)
- open(snk, BOOST_IOS::out);
- if (end_ != -1 && pos_ + n >= end_)
- bad_write();
- std::streamsize result =
- iostreams::write(this->component(), snk, s, n);
- pos_ += result;
- return result;
- }
-
- template<typename Device>
- std::streampos seek(Device& dev, stream_offset off, BOOST_IOS::seekdir way)
- {
- stream_offset next;
- if (way == BOOST_IOS::beg) {
- next = beg_ + off;
- } else if (way == BOOST_IOS::cur) {
- next = pos_ + off;
- } else if (end_ != -1) {
- next = end_ + off;
- } else {
- // Restriction is half-open; seek relative to the actual end.
- pos_ = this->component().seek(dev, off, BOOST_IOS::end);
- if (pos_ < beg_)
- bad_seek();
- return offset_to_position(pos_ - beg_);
- }
- if (next < beg_ || end_ != -1 && next >= end_)
- bad_seek();
- pos_ = this->component().seek(dev, next, BOOST_IOS::cur);
- return offset_to_position(pos_ - beg_);
- }
-
- template<typename Device>
- void close(Device& dev)
- {
- open_ = false;
- detail::close_all(this->component(), dev);
- }
-
- template<typename Device>
- void close(Device& dev, BOOST_IOS::openmode which)
- {
- open_ = false;
- iostreams::close(this->component(), dev, which);
- }
-private:
- template<typename Device>
- void open(Device& dev, BOOST_IOS::openmode which)
- {
- typedef typename is_convertible<mode, dual_use>::type is_dual_use;
- open_ = true;
- which = is_dual_use() ? which : (BOOST_IOS::in | BOOST_IOS::out);
- iostreams::skip(this->component(), dev, beg_, which);
- }
-
- stream_offset beg_, pos_, end_;
- bool open_;
-};
-
-template<typename T>
-struct restriction_traits
- : iostreams::select< // Disambiguation for Tru64.
- is_filter<T>, restricted_filter<T>,
- is_direct<T>, restricted_direct_device<T>,
- else_, restricted_indirect_device<T>
- >
- { };
-
-} // End namespace detail.
-
-template<typename T>
-struct restriction : public detail::restriction_traits<T>::type {
- typedef typename detail::param_type<T>::type param_type;
- typedef typename detail::restriction_traits<T>::type base_type;
- restriction(param_type t, stream_offset off, stream_offset len = -1)
- : base_type(t, off, len)
- { }
-};
-
-//--------------Implementation of restrict------------------------------------//
-
-// Note: The following workarounds are patterned after resolve.hpp. It has not
-// yet been confirmed that they are necessary.
-
-#ifndef BOOST_IOSTREAMS_BROKEN_OVERLOAD_RESOLUTION //-------------------------//
-# ifndef BOOST_IOSTREAMS_NO_STREAM_TEMPLATES //-------------------------------//
-
-template<typename T>
-restriction<T> restrict( const T& t, stream_offset off, stream_offset len = -1
- BOOST_IOSTREAMS_DISABLE_IF_STREAM(T) )
-{ return restriction<T>(t, off, len); }
-
-template<typename Ch, typename Tr>
-restriction< std::basic_streambuf<Ch, Tr> >
-restrict(std::basic_streambuf<Ch, Tr>& sb, stream_offset off, stream_offset len = -1)
-{ return restriction< std::basic_streambuf<Ch, Tr> >(sb, off, len); }
-
-template<typename Ch, typename Tr>
-restriction< std::basic_istream<Ch, Tr> >
-restrict(std::basic_istream<Ch, Tr>& is, stream_offset off, stream_offset len = -1)
-{ return restriction< std::basic_istream<Ch, Tr> >(is, off, len); }
-
-template<typename Ch, typename Tr>
-restriction< std::basic_ostream<Ch, Tr> >
-restrict(std::basic_ostream<Ch, Tr>& os, stream_offset off, stream_offset len = -1)
-{ return restriction< std::basic_ostream<Ch, Tr> >(os, off, len); }
-
-template<typename Ch, typename Tr>
-restriction< std::basic_iostream<Ch, Tr> >
-restrict(std::basic_iostream<Ch, Tr>& io, stream_offset off, stream_offset len = -1)
-{ return restriction< std::basic_iostream<Ch, Tr> >(io, off, len); }
-
-# else // # ifndef BOOST_IOSTREAMS_NO_STREAM_TEMPLATES //---------------------//
-
-template<typename T>
-restriction<T> restrict( const T& t, stream_offset off, stream_offset len = -1
- BOOST_IOSTREAMS_DISABLE_IF_STREAM(T) )
-{ return restriction<T>(t, off, len); }
-
-restriction<std::streambuf>
-restrict(std::streambuf& sb, stream_offset off, stream_offset len = -1)
-{ return restriction<std::streambuf>(sb, off, len); }
-
-restriction<std::istream>
-restrict(std::istream<Ch, Tr>& is, stream_offset off, stream_offset len = -1)
-{ return restriction<std::istream>(is, off, len); }
-
-restriction<std::ostream>
-restrict(std::ostream<Ch, Tr>& os, stream_offset off, stream_offset len = -1)
-{ return restriction<std::ostream>(os, off, len); }
-
-restriction<std::iostream>
-restrict(std::iostream<Ch, Tr>& io, stream_offset off, stream_offset len = -1)
-{ return restriction<std::iostream>(io, off, len); }
-
-# endif // # ifndef BOOST_IOSTREAMS_NO_STREAM_TEMPLATES //--------------------//
-#else // #ifndef BOOST_IOSTREAMS_BROKEN_OVERLOAD_RESOLUTION //----------------//
-
-template<typename T>
-restriction<T>
-restrict(const T& t, stream_offset off, stream_offset len, mpl::true_)
-{ // Bad overload resolution.
- return restriction<T>(const_cast<T&>(t, off, len));
-}
-
-template<typename T>
-restriction<T>
-restrict(const T& t, stream_offset off, stream_offset len, mpl::false_)
-{ return restriction<T>(t, off, len); }
-
-template<typename T>
-restriction<T>
-restrict( const T& t, stream_offset off, stream_offset len = -1
- BOOST_IOSTREAMS_DISABLE_IF_STREAM(T) )
-{ return restrict(t, off, len, is_std_io<T>()); }
-
-# if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && \
- !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) && \
- !defined(__GNUC__) // ---------------------------------------------------//
-
-template<typename T>
-restriction<T>
-restrict(T& t, stream_offset off, stream_offset len = -1)
-{ return restriction<T>(t, off, len); }
-
-# endif // Borland 5.x, VC6-7.0 or GCC 2.9x //--------------------------------//
-#endif // #ifndef BOOST_IOSTREAMS_BROKEN_OVERLOAD_RESOLUTION //---------------//
-//----------------------------------------------------------------------------//
-
-namespace detail {
-
-//--------------Implementation of restricted_indirect_device------------------//
-
-template<typename Device>
-restricted_indirect_device<Device>::restricted_indirect_device
- (param_type dev, stream_offset off, stream_offset len)
- : device_adapter<Device>(dev), beg_(off), pos_(off),
- end_(len != -1 ? off + len : -1)
-{
- if (len < -1 || off < 0)
- throw BOOST_IOSTREAMS_FAILURE("bad offset");
- iostreams::skip(this->component(), off);
-}
-
-template<typename Device>
-inline std::streamsize restricted_indirect_device<Device>::read
- (char_type* s, std::streamsize n)
-{
- using namespace std;
- streamsize amt =
- end_ != -1 ?
- (std::min) (n, static_cast<streamsize>(end_ - pos_)) :
- n;
- streamsize result = iostreams::read(this->component(), s, amt);
- if (result != -1)
- pos_ += result;
- return result;
-}
-
-template<typename Device>
-inline std::streamsize restricted_indirect_device<Device>::write
- (const char_type* s, std::streamsize n)
-{
- if (end_ != -1 && pos_ + n >= end_)
- bad_write();
- std::streamsize result = iostreams::write(this->component(), s, n);
- pos_ += result;
- return result;
-}
-
-template<typename Device>
-std::streampos restricted_indirect_device<Device>::seek
- (stream_offset off, BOOST_IOS::seekdir way)
-{
- stream_offset next;
- if (way == BOOST_IOS::beg) {
- next = beg_ + off;
- } else if (way == BOOST_IOS::cur) {
- next = pos_ + off;
- } else if (end_ != -1) {
- next = end_ + off;
- } else {
- // Restriction is half-open; seek relative to the actual end.
- pos_ = iostreams::seek(this->component(), off, BOOST_IOS::end);
- if (pos_ < beg_)
- bad_seek();
- return offset_to_position(pos_ - beg_);
- }
- if (next < beg_ || end_ != -1 && next >= end_)
- bad_seek();
- pos_ = iostreams::seek(this->component(), next - pos_, BOOST_IOS::cur);
- return offset_to_position(pos_ - beg_);
-}
-
-//--------------Implementation of restricted_direct_device--------------------//
-
-template<typename Device>
-restricted_direct_device<Device>::restricted_direct_device
- (const Device& dev, stream_offset off, stream_offset len)
- : device_adapter<Device>(dev), beg_(0), end_(0)
-{
- std::pair<char_type*, char_type*> seq =
- sequence(is_convertible<category, input>());
- if ( off < 0 || len < -1 ||
- len != -1 && off + len > seq.second - seq.first )
- {
- throw BOOST_IOSTREAMS_FAILURE("bad offset");
- }
- beg_ = seq.first + off;
- end_ = len != -1 ?
- seq.first + off + len :
- seq.second;
-}
-
-template<typename Device>
-typename restricted_direct_device<Device>::pair_type
-restricted_direct_device<Device>::input_sequence()
-{
- BOOST_STATIC_ASSERT((is_convertible<category, input>::value));
- return std::make_pair(beg_, end_);
-}
-
-template<typename Device>
-typename restricted_direct_device<Device>::pair_type
-restricted_direct_device<Device>::output_sequence()
-{
- BOOST_STATIC_ASSERT((is_convertible<category, output>::value));
- return std::make_pair(beg_, end_);
-}
-
-template<typename Device>
-typename restricted_direct_device<Device>::pair_type
-restricted_direct_device<Device>::sequence(mpl::true_)
-{ return iostreams::input_sequence(this->component()); }
-
-template<typename Device>
-typename restricted_direct_device<Device>::pair_type
-restricted_direct_device<Device>::sequence(mpl::false_)
-{ return iostreams::output_sequence(this->component()); }
-
-//--------------Implementation of restricted_filter---------------------------//
-
-template<typename Filter>
-restricted_filter<Filter>::restricted_filter
- (const Filter& flt, stream_offset off, stream_offset len)
- : filter_adapter<Filter>(flt), beg_(off),
- pos_(off), end_(len != -1 ? off + len : -1), open_(false)
-{
- if (len < -1 || off < 0)
- throw BOOST_IOSTREAMS_FAILURE("bad offset");
-}
-
-} // End namespace detail.
-
-} } // End namespaces iostreams, boost.
-
+#include <boost/iostreams/detail/restrict_impl.hpp>
+#define BOOST_IOSTREAMS_RESTRICT restrict
+#include <boost/iostreams/detail/restrict_impl.hpp>
+#undef BOOST_IOSTREAMS_RESTRICT
 
 #endif // #ifndef BOOST_IOSTREAMS_RESTRICT_HPP_INCLUDED

Modified: branches/fix-links/boost/math/distributions/poisson.hpp
==============================================================================
--- branches/fix-links/boost/math/distributions/poisson.hpp (original)
+++ branches/fix-links/boost/math/distributions/poisson.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -334,22 +334,7 @@
       { // mean ^ k = 1, and k! = 1, so can simplify.
         return exp(-mean);
       }
- using boost::math::unchecked_factorial;
- RealType floork = floor(k);
- if ((floork == k) // integral
- && k < max_factorial<RealType>::value)
- { // k is small enough (for float 34, double 170 ...) to use factorial(k).
- return exp(-mean) * pow(mean, k) /
- unchecked_factorial<RealType>(tools::real_cast<unsigned int>(floork));
- }
- else
- { // Need to use log(factorial(k)) = lgamma(k+1)
- // (e ^ -mean * mean ^ k) / k!
- // == exp(log(e ^ -mean) + log (mean ^ k) - lgamma(k+1))
- // exp( -mean + log(mean) * k - lgamma(k+1))
- return exp(-mean + log(mean) * k - boost::math::lgamma(k+1, Policy()));
- // return gamma_p_derivative(k+1, mean); // equivalent & also passes tests.
- }
+ return boost::math::gamma_p_derivative(k+1, mean, Policy());
     } // pdf
 
     template <class RealType, class Policy>

Modified: branches/fix-links/boost/math/tools/test_data.hpp
==============================================================================
--- branches/fix-links/boost/math/tools/test_data.hpp (original)
+++ branches/fix-links/boost/math/tools/test_data.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -27,6 +27,7 @@
 
 #include <set>
 #include <vector>
+#include <iostream>
 
 #ifdef BOOST_MSVC
 # pragma warning(push)

Modified: branches/fix-links/boost/mpi/config.hpp
==============================================================================
--- branches/fix-links/boost/mpi/config.hpp (original)
+++ branches/fix-links/boost/mpi/config.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -20,6 +20,11 @@
 #include <mpi.h>
 #include <boost/config.hpp>
 
+/** @brief Define this macro to avoid expensice MPI_Pack/Unpack calls on
+ * homogeneous machines.
+*/
+//#define BOOST_MPI_HOMOGENEOUS
+
 // If this is an MPI-2 implementation, define configuration macros for
 // the features we are interested in.
 #if defined(MPI_VERSION) && MPI_VERSION == 2

Modified: branches/fix-links/boost/mpi/datatype.hpp
==============================================================================
--- branches/fix-links/boost/mpi/datatype.hpp (original)
+++ branches/fix-links/boost/mpi/datatype.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -23,6 +23,7 @@
 #include <boost/config.hpp>
 #include <boost/mpl/bool.hpp>
 #include <boost/mpl/or.hpp>
+#include <boost/mpl/and.hpp>
 #include <boost/mpi/detail/mpi_datatype_cache.hpp>
 #include <boost/mpl/assert.hpp>
 #include <utility> // for std::pair
@@ -199,6 +200,9 @@
 {}
 
 /// INTERNAL ONLY
+BOOST_MPI_DATATYPE(packed, MPI_PACKED, builtin);
+
+/// INTERNAL ONLY
 BOOST_MPI_DATATYPE(char, MPI_CHAR, builtin);
 
 /// INTERNAL ONLY
@@ -252,6 +256,14 @@
 BOOST_MPI_DATATYPE(std::pair<BOOST_MPI_LIST2(int, int>), MPI_2INT, builtin);
 #undef BOOST_MPI_LIST2
 
+/// specialization of is_mpi_datatype for pairs
+template <class T, class U>
+struct is_mpi_datatype<std::pair<T,U> >
+ : public mpl::and_<is_mpi_datatype<T>,is_mpi_datatype<U> >
+{
+};
+
+
 #if 0
 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
 BOOST_MPI_DATATYPE(wchar_t, MPI_WCHAR, builtin);
@@ -265,6 +277,11 @@
 
 #endif // Doxygen
 
+#if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN)
+BOOST_MPI_DATATYPE(__int64, MPI_LONG_LONG_INT, builtin);
+BOOST_MPI_DATATYPE(unsigned __int64, MPI_UNSIGNED_LONG_LONG, builtin);
+#endif
+
 namespace detail {
   inline MPI_Datatype build_mpi_datatype_for_bool()
   {
@@ -290,11 +307,16 @@
   : boost::mpl::bool_<true>
 {};
 
-/// INTERNAL ONLY
-template<typename T, typename U>
-struct is_mpi_datatype<std::pair<T, U> >
- : mpl::and_<is_mpi_datatype<T>, is_mpi_datatype<U> > { };
-
 } } // end namespace boost::mpi
 
+// define a macro to make explicit designation of this more transparent
+#define BOOST_IS_MPI_DATATYPE(T) \
+namespace boost { \
+namespace mpi { \
+template<> \
+struct is_mpi_datatype< T > : mpl::true_ {}; \
+}} \
+/**/
+
+
 #endif // BOOST_MPI_MPI_DATATYPE_HPP

Modified: branches/fix-links/boost/mpi/datatype_fwd.hpp
==============================================================================
--- branches/fix-links/boost/mpi/datatype_fwd.hpp (original)
+++ branches/fix-links/boost/mpi/datatype_fwd.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -27,6 +27,8 @@
 template<typename T> struct is_mpi_datatype;
 template<typename T> MPI_Datatype get_mpi_datatype(const T& x = T());
 
+/// a dummy data type giving MPI_PACKED as its MPI_Datatype
+struct packed {};
 } } // end namespace boost::mpi
 
 #endif // BOOST_MPI_MPI_DATATYPE_FWD_HPP

Modified: branches/fix-links/boost/mpi/detail/packed_iprimitive.hpp
==============================================================================
--- branches/fix-links/boost/mpi/detail/packed_iprimitive.hpp (original)
+++ branches/fix-links/boost/mpi/detail/packed_iprimitive.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -65,20 +65,19 @@
 
     // fast saving of arrays of fundamental types
     template<class T>
- void load_array(serialization::array<T> & x, unsigned int /* file_version */)
+ void load_array(serialization::array<T> const& x, unsigned int /* file_version */)
     {
       if (x.count())
         load_impl(x.address(), get_mpi_datatype(*x.address()), x.count());
     }
 
- typedef is_mpi_datatype<mpl::_1> use_array_optimization;
+ template<class T>
+ void load(serialization::array<T> const& x)
+ {
+ load_array(x,0u);
+ }
 
-#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
- friend class archive::load_access;
-protected:
-#else
-public:
-#endif
+ typedef is_mpi_datatype<mpl::_1> use_array_optimization;
 
     // default saving of primitives.
     template<class T>

Modified: branches/fix-links/boost/mpi/packed_iarchive.hpp
==============================================================================
--- branches/fix-links/boost/mpi/packed_iarchive.hpp (original)
+++ branches/fix-links/boost/mpi/packed_iarchive.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -23,10 +23,17 @@
 #include <boost/archive/basic_binary_iarchive.hpp>
 #include <boost/archive/shared_ptr_helper.hpp>
 #include <boost/mpi/detail/packed_iprimitive.hpp>
+#include <boost/mpi/detail/binary_buffer_iprimitive.hpp>
 #include <boost/assert.hpp>
 
 namespace boost { namespace mpi {
 
+#ifdef BOOST_MPI_HOMOGENEOUS
+ typedef binary_buffer_iprimitive iprimitive;
+#else
+ typedef packed_iprimitive iprimitive;
+#endif
+
 /** @brief An archive that packs binary data into an MPI buffer.
  *
  * The @c packed_iarchive class is an Archiver (as in the
@@ -36,7 +43,7 @@
  * implementation to perform serialization.
  */
 class BOOST_MPI_DECL packed_iarchive
- : public packed_iprimitive
+ : public iprimitive
   , public archive::basic_binary_iarchive<packed_iarchive>
   , public archive::detail::shared_ptr_helper
 {
@@ -59,7 +66,7 @@
    * deserialization will begin.
    */
   packed_iarchive(MPI_Comm const & comm, buffer_type & b, unsigned int flags = boost::archive::no_header, int position = 0)
- : packed_iprimitive(b,comm,position),
+ : iprimitive(b,comm,position),
           archive::basic_binary_iarchive<packed_iarchive>(flags)
         {}
 
@@ -70,16 +77,44 @@
    * @param comm The communicator over which this archive will be
    * sent.
    *
+ * @param s The size of the buffer to be received.
+ *
    * @param flags Control the serialization of the data types. Refer
    * to the Boost.Serialization documentation before changing the
    * default flags.
    */
   packed_iarchive
- ( MPI_Comm const & comm , unsigned int flags = boost::archive::no_header)
- : packed_iprimitive(internal_buffer_,comm),
- archive::basic_binary_iarchive<packed_iarchive>(flags)
+ ( MPI_Comm const & comm , std::size_t s=0,
+ unsigned int flags = boost::archive::no_header)
+ : iprimitive(internal_buffer_,comm)
+ , archive::basic_binary_iarchive<packed_iarchive>(flags)
+ , internal_buffer_(s)
         {}
 
+ // Load everything else in the usual way, forwarding on to the Base class
+ template<class T>
+ void load_override(T& x, int version, mpl::false_)
+ {
+ archive::basic_binary_iarchive<packed_iarchive>::load_override(x,version);
+ }
+
+ // Load it directly using the primnivites
+ template<class T>
+ void load_override(T& x, int version, mpl::true_)
+ {
+ iprimitive::load(x);
+ }
+
+ // Load all supported datatypes directly
+ template<class T>
+ void load_override(T& x, int version)
+ {
+ typedef typename mpl::apply1<use_array_optimization
+ , BOOST_DEDUCED_TYPENAME remove_const<T>::type
+ >::type use_optimized;
+ load_override(x, version, use_optimized());
+ }
+
 private:
   /// An internal buffer to be used when the user does not supply his
   /// own buffer.

Modified: branches/fix-links/boost/mpi/packed_oarchive.hpp
==============================================================================
--- branches/fix-links/boost/mpi/packed_oarchive.hpp (original)
+++ branches/fix-links/boost/mpi/packed_oarchive.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -22,9 +22,16 @@
 #include <boost/archive/detail/auto_link_archive.hpp>
 #include <boost/archive/basic_binary_oarchive.hpp>
 #include <boost/mpi/detail/packed_oprimitive.hpp>
+#include <boost/mpi/detail/binary_buffer_oprimitive.hpp>
 
 namespace boost { namespace mpi {
 
+#ifdef BOOST_MPI_HOMOGENEOUS
+ typedef binary_buffer_oprimitive oprimitive;
+#else
+ typedef packed_oprimitive oprimitive;
+#endif
+
 /** @brief An archive that unpacks binary data from an MPI buffer.
  *
  * The @c packed_oarchive class is an Archiver (as in the
@@ -33,8 +40,9 @@
  * type and will use the @c MPI_Unpack function of the underlying MPI
  * implementation to perform deserialization.
  */
+
 class BOOST_MPI_DECL packed_oarchive
- : public packed_oprimitive,
+ : public oprimitive,
     public archive::basic_binary_oarchive<packed_oarchive>
 {
 public:
@@ -53,7 +61,7 @@
    * default flags.
    */
   packed_oarchive( MPI_Comm const & comm, buffer_type & b, unsigned int flags = boost::archive::no_header)
- : packed_oprimitive(b,comm),
+ : oprimitive(b,comm),
            archive::basic_binary_oarchive<packed_oarchive>(flags)
         {}
 
@@ -69,10 +77,31 @@
    * default flags.
    */
   packed_oarchive ( MPI_Comm const & comm, unsigned int flags = boost::archive::no_header)
- : packed_oprimitive(internal_buffer_,comm),
+ : oprimitive(internal_buffer_,comm),
            archive::basic_binary_oarchive<packed_oarchive>(flags)
         {}
 
+ // Save everything else in the usual way, forwarding on to the Base class
+ template<class T>
+ void save_override(T const& x, int version, mpl::false_)
+ {
+ archive::basic_binary_oarchive<packed_oarchive>::save_override(x,version);
+ }
+
+ // Save it directly using the primnivites
+ template<class T>
+ void save_override(T const& x, int version, mpl::true_)
+ {
+ oprimitive::save(x);
+ }
+
+ // Save all supported datatypes directly
+ template<class T>
+ void save_override(T const& x, int version)
+ {
+ typedef typename mpl::apply1<use_array_optimization,T>::type use_optimized;
+ save_override(x, version, use_optimized());
+ }
 
 private:
   /// An internal buffer to be used when the user does not supply his
@@ -86,4 +115,5 @@
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::packed_oarchive)
 
 
+
 #endif // BOOST_MPI_PACKED_OARCHIVE_HPP

Modified: branches/fix-links/boost/mpi/status.hpp
==============================================================================
--- branches/fix-links/boost/mpi/status.hpp (original)
+++ branches/fix-links/boost/mpi/status.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -34,6 +34,8 @@
 {
  public:
   status() : m_count(-1) { }
+
+ status(MPI_Status const& s) : m_status(s), m_count(-1) {}
 
   /**
    * Retrieve the source of the message.

Modified: branches/fix-links/boost/parameter/aux_/arg_list.hpp
==============================================================================
--- branches/fix-links/boost/parameter/aux_/arg_list.hpp (original)
+++ branches/fix-links/boost/parameter/aux_/arg_list.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -24,6 +24,7 @@
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/is_base_and_derived.hpp>
 #include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
 #include <boost/preprocessor/facilities/intercept.hpp>
 
 namespace boost { namespace parameter {

Modified: branches/fix-links/boost/parameter/aux_/cast.hpp
==============================================================================
--- branches/fix-links/boost/parameter/aux_/cast.hpp (original)
+++ branches/fix-links/boost/parameter/aux_/cast.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -5,6 +5,8 @@
 #ifndef BOOST_PARAMETER_CAST_060902_HPP
 # define BOOST_PARAMETER_CAST_060902_HPP
 
+# include <boost/detail/workaround.hpp>
+
 # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
   && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
 # include <boost/type_traits/add_reference.hpp>

Modified: branches/fix-links/boost/parameter/aux_/default.hpp
==============================================================================
--- branches/fix-links/boost/parameter/aux_/default.hpp (original)
+++ branches/fix-links/boost/parameter/aux_/default.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -4,7 +4,9 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 
 #ifndef DEFAULT_050329_HPP
-#define DEFAULT_050329_HPP
+# define DEFAULT_050329_HPP
+
+# include <boost/detail/workaround.hpp>
 
 namespace boost { namespace parameter { namespace aux {
 
@@ -27,7 +29,7 @@
 // the user when resolving the value of the parameter with the
 // given keyword
 //
-#if BOOST_WORKAROUND(__EDG_VERSION__, <= 300)
+# if BOOST_WORKAROUND(__EDG_VERSION__, <= 300)
 // These compilers need a little extra help with overload
 // resolution; we have empty_arg_list's operator[] accept a base
 // class to make that overload less preferable.
@@ -48,8 +50,8 @@
         : lazy_default_base<KW,DefaultComputer>(x)
       {}
   };
-# define BOOST_PARAMETER_lazy_default_fallback lazy_default_base
-#else
+# define BOOST_PARAMETER_lazy_default_fallback lazy_default_base
+# else
 template <class KW, class DefaultComputer>
 struct lazy_default
 {
@@ -58,8 +60,8 @@
     {}
     DefaultComputer const& compute_default;
 };
-# define BOOST_PARAMETER_lazy_default_fallback lazy_default
-#endif
+# define BOOST_PARAMETER_lazy_default_fallback lazy_default
+# endif
 
 }}} // namespace boost::parameter::aux
 

Modified: branches/fix-links/boost/parameter/aux_/python/invoker.hpp
==============================================================================
--- branches/fix-links/boost/parameter/aux_/python/invoker.hpp (original)
+++ branches/fix-links/boost/parameter/aux_/python/invoker.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -8,6 +8,7 @@
 # include <boost/mpl/begin.hpp>
 # include <boost/mpl/next.hpp>
 # include <boost/mpl/deref.hpp>
+# include <boost/mpl/size.hpp>
 # include <boost/parameter/keyword.hpp>
 # include <boost/preprocessor/iteration/iterate.hpp>
 

Modified: branches/fix-links/boost/parameter/aux_/set.hpp
==============================================================================
--- branches/fix-links/boost/parameter/aux_/set.hpp (original)
+++ branches/fix-links/boost/parameter/aux_/set.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -5,6 +5,8 @@
 #ifndef BOOST_PARAMETER_SET_060912_HPP
 # define BOOST_PARAMETER_SET_060912_HPP
 
+# include <boost/detail/workaround.hpp>
+
 # if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \
   && !BOOST_WORKAROUND(__GNUC__, < 3)
 # include <boost/mpl/insert.hpp>

Modified: branches/fix-links/boost/parameter/macros.hpp
==============================================================================
--- branches/fix-links/boost/parameter/macros.hpp (original)
+++ branches/fix-links/boost/parameter/macros.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -15,6 +15,7 @@
 #include <boost/preprocessor/repetition/enum_params.hpp>
 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
 #include <boost/preprocessor/cat.hpp>
+#include <boost/detail/workaround.hpp>
 
 #define BOOST_PARAMETER_FUN_TEMPLATE_HEAD1(n) \
     template<BOOST_PP_ENUM_PARAMS(n, class T)>

Modified: branches/fix-links/boost/parameter/preprocessor.hpp
==============================================================================
--- branches/fix-links/boost/parameter/preprocessor.hpp (original)
+++ branches/fix-links/boost/parameter/preprocessor.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -14,6 +14,7 @@
 # include <boost/parameter/aux_/preprocessor/flatten.hpp>
 
 # include <boost/preprocessor/repetition/repeat_from_to.hpp>
+# include <boost/preprocessor/comparison/equal.hpp>
 # include <boost/preprocessor/control/if.hpp>
 # include <boost/preprocessor/control/expr_if.hpp>
 # include <boost/preprocessor/repetition/enum_params.hpp>
@@ -23,9 +24,11 @@
 # include <boost/preprocessor/seq/for_each_product.hpp>
 # include <boost/preprocessor/seq/for_each_i.hpp>
 # include <boost/preprocessor/tuple/elem.hpp>
+# include <boost/preprocessor/tuple/eat.hpp>
 # include <boost/preprocessor/seq/fold_left.hpp>
 # include <boost/preprocessor/seq/size.hpp>
 # include <boost/preprocessor/seq/enum.hpp>
+# include <boost/preprocessor/seq/push_back.hpp>
 
 # include <boost/preprocessor/detail/is_nullary.hpp>
 

Modified: branches/fix-links/boost/range/as_literal.hpp
==============================================================================
--- branches/fix-links/boost/range/as_literal.hpp (original)
+++ branches/fix-links/boost/range/as_literal.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -15,7 +15,7 @@
 # pragma once
 #endif
 
-#if BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
 #include <boost/range/detail/as_literal.hpp>
 #else
 
@@ -116,14 +116,14 @@
 
     
     template< class Char, std::size_t sz >
- inline iterator_range<const Char*> as_literal( const Char (&arr)[sz] )
+ inline iterator_range<const Char*> as_literal( const Char (&arr)[sz] )
     {
 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x590)) && __BORLANDC__ >= 0x590
         return boost::make_iterator_range<const Char*>( arr, arr + sz - 1 );
 #else
         return boost::make_iterator_range( arr, arr + sz - 1 );
 #endif
- }
+ }
 }
 
 #endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING

Modified: branches/fix-links/boost/regex/concepts.hpp
==============================================================================
--- branches/fix-links/boost/regex/concepts.hpp (original)
+++ branches/fix-links/boost/regex/concepts.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -235,7 +235,7 @@
 struct BaseRegexConcept
 {
    typedef typename Regex::value_type value_type;
- typedef typename Regex::size_type size_type;
+ //typedef typename Regex::size_type size_type;
    typedef typename Regex::flag_type flag_type;
    typedef typename Regex::locale_type locale_type;
    typedef input_iterator_archetype<value_type> input_iterator_type;
@@ -370,7 +370,7 @@
       const Regex ce;
       bool b = ce.empty();
       ignore_unused_variable_warning(b);
- size_type i = ce.mark_count();
+ unsigned i = ce.mark_count();
       ignore_unused_variable_warning(i);
       m_flags = ce.flags();
       e.imbue(ce.getloc());
@@ -533,7 +533,7 @@
 
    pointer_type m_pointer;
    flag_type m_flags;
- size_type m_size;
+ std::size_t m_size;
    input_iterator_type in1, in2;
    const sub_match_type m_sub;
    const value_type m_char;
@@ -557,7 +557,7 @@
 struct RegexConcept
 {
    typedef typename Regex::value_type value_type;
- typedef typename Regex::size_type size_type;
+ //typedef typename Regex::size_type size_type;
    typedef typename Regex::flag_type flag_type;
    typedef typename Regex::locale_type locale_type;
 

Modified: branches/fix-links/boost/regex/v4/basic_regex_parser.hpp
==============================================================================
--- branches/fix-links/boost/regex/v4/basic_regex_parser.hpp (original)
+++ branches/fix-links/boost/regex/v4/basic_regex_parser.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -784,6 +784,7 @@
       case syntax_element_restart_continue:
       case syntax_element_jump:
       case syntax_element_startmark:
+ case syntax_element_backstep:
          // can't legally repeat any of the above:
          fail(regex_constants::error_badrepeat, m_position - m_base);
          return false;
@@ -1869,6 +1870,7 @@
    if(markid == -4)
    {
       re_syntax_base* b = this->getaddress(expected_alt_point);
+ // Make sure we have exactly one alternative following this state:
       if(b->type != syntax_element_alt)
       {
          re_alt* alt = static_cast<re_alt*>(this->insert_state(expected_alt_point, syntax_element_alt, sizeof(re_alt)));
@@ -1879,6 +1881,15 @@
          fail(regex_constants::error_bad_pattern, m_position - m_base);
          return false;
       }
+ // check for invalid repetition of next state:
+ b = this->getaddress(expected_alt_point);
+ b = this->getaddress(static_cast<re_alt*>(b)->next.i, b);
+ if((b->type != syntax_element_assert_backref)
+ && (b->type != syntax_element_startmark))
+ {
+ fail(regex_constants::error_badrepeat, m_position - m_base);
+ return false;
+ }
    }
    //
    // append closing parenthesis state:

Modified: branches/fix-links/boost/serialization/complex.hpp
==============================================================================
--- branches/fix-links/boost/serialization/complex.hpp (original)
+++ branches/fix-links/boost/serialization/complex.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -22,6 +22,7 @@
 
 #include <boost/serialization/nvp.hpp>
 #include <boost/serialization/is_bitwise_serializable.hpp>
+#include <boost/serialization/split_free.hpp>
 
 namespace boost {
 namespace serialization {

Modified: branches/fix-links/boost/serialization/utility.hpp
==============================================================================
--- branches/fix-links/boost/serialization/utility.hpp (original)
+++ branches/fix-links/boost/serialization/utility.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -50,9 +50,9 @@
 {
 };
 
-template <class T, class U>
-struct implementation_level<std::pair<T,U> >
- : mpl::int_<object_serializable> {} ;
+//template <class T, class U>
+//struct implementation_level<std::pair<T,U> >
+// : mpl::int_<object_serializable> {} ;
 
 } // serialization
 } // namespace boost

Modified: branches/fix-links/boost/spirit/core/primitives/primitives.hpp
==============================================================================
--- branches/fix-links/boost/spirit/core/primitives/primitives.hpp (original)
+++ branches/fix-links/boost/spirit/core/primitives/primitives.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -609,7 +609,7 @@
 
     ///////////////////////////////////////////////////////////////////////////
     //
- // end_parser class (suggested by Markus Schöpflin)
+ // end_parser class (suggested by Markus Schoepflin)
     //
     ///////////////////////////////////////////////////////////////////////////
     struct end_parser : public parser<end_parser>

Modified: branches/fix-links/boost/statechart/detail/rtti_policy.hpp
==============================================================================
--- branches/fix-links/boost/statechart/detail/rtti_policy.hpp (original)
+++ branches/fix-links/boost/statechart/detail/rtti_policy.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,7 +1,7 @@
 #ifndef BOOST_STATECHART_DETAIL_RTTI_POLICY_HPP_INCLUDED
 #define BOOST_STATECHART_DETAIL_RTTI_POLICY_HPP_INCLUDED
 //////////////////////////////////////////////////////////////////////////////
-// Copyright 2002-2006 Andreas Huber Doenni
+// Copyright 2002-2008 Andreas Huber Doenni
 // Distributed under the Boost Software License, Version 1.0. (See accompany-
 // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 //////////////////////////////////////////////////////////////////////////////
@@ -16,15 +16,6 @@
 
 
 
-#ifdef BOOST_MSVC
-// We permanently turn off the following level 4 warnings because users will
-// have to do so themselves anyway if we turn them back on
-# pragma warning( disable: 4511 ) // copy constructor could not be generated
-# pragma warning( disable: 4512 ) // assignment operator could not be generated
-#endif
-
-
-
 namespace boost
 {
 namespace statechart

Modified: branches/fix-links/boost/statechart/detail/state_base.hpp
==============================================================================
--- branches/fix-links/boost/statechart/detail/state_base.hpp (original)
+++ branches/fix-links/boost/statechart/detail/state_base.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,7 +1,7 @@
 #ifndef BOOST_STATECHART_DETAIL_STATE_BASE_HPP_INCLUDED
 #define BOOST_STATECHART_DETAIL_STATE_BASE_HPP_INCLUDED
 //////////////////////////////////////////////////////////////////////////////
-// Copyright 2002-2006 Andreas Huber Doenni
+// Copyright 2002-2008 Andreas Huber Doenni
 // Distributed under the Boost Software License, Version 1.0. (See accompany-
 // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 //////////////////////////////////////////////////////////////////////////////
@@ -34,15 +34,6 @@
 
 
 
-#ifdef BOOST_MSVC
-// We permanently turn off the following level 4 warnings because users will
-// have to do so themselves anyway if we turn them back on
-# pragma warning( disable: 4511 ) // copy constructor could not be generated
-# pragma warning( disable: 4512 ) // assignment operator could not be generated
-#endif
-
-
-
 namespace boost
 {
 namespace statechart

Modified: branches/fix-links/boost/statechart/event.hpp
==============================================================================
--- branches/fix-links/boost/statechart/event.hpp (original)
+++ branches/fix-links/boost/statechart/event.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,7 +1,7 @@
 #ifndef BOOST_STATECHART_EVENT_HPP_INCLUDED
 #define BOOST_STATECHART_EVENT_HPP_INCLUDED
 //////////////////////////////////////////////////////////////////////////////
-// Copyright 2002-2006 Andreas Huber Doenni
+// Copyright 2002-2007 Andreas Huber Doenni
 // Distributed under the Boost Software License, Version 1.0. (See accompany-
 // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 //////////////////////////////////////////////////////////////////////////////

Modified: branches/fix-links/boost/statechart/event_processor.hpp
==============================================================================
--- branches/fix-links/boost/statechart/event_processor.hpp (original)
+++ branches/fix-links/boost/statechart/event_processor.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,7 +1,7 @@
 #ifndef BOOST_STATECHART_EVENT_PROCESSOR_INCLUDED
 #define BOOST_STATECHART_EVENT_PROCESSOR_INCLUDED
 //////////////////////////////////////////////////////////////////////////////
-// Copyright 2002-2006 Andreas Huber Doenni
+// Copyright 2002-2008 Andreas Huber Doenni
 // Distributed under the Boost Software License, Version 1.0. (See accompany-
 // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 //////////////////////////////////////////////////////////////////////////////
@@ -70,6 +70,9 @@
     virtual void process_event_impl( const event_base & evt ) = 0;
     virtual void terminate_impl() = 0;
 
+ // avoids C4512 (assignment operator could not be generated)
+ event_processor & operator=( const event_processor & );
+
     Scheduler & myScheduler_;
     const processor_handle myHandle_;
 };

Modified: branches/fix-links/boost/statechart/fifo_worker.hpp
==============================================================================
--- branches/fix-links/boost/statechart/fifo_worker.hpp (original)
+++ branches/fix-links/boost/statechart/fifo_worker.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,7 +1,7 @@
 #ifndef BOOST_STATECHART_FIFO_WORKER_HPP_INCLUDED
 #define BOOST_STATECHART_FIFO_WORKER_HPP_INCLUDED
 //////////////////////////////////////////////////////////////////////////////
-// Copyright 2002-2006 Andreas Huber Doenni
+// Copyright 2002-2008 Andreas Huber Doenni
 // Distributed under the Boost Software License, Version 1.0. (See accompany-
 // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 //////////////////////////////////////////////////////////////////////////////
@@ -20,7 +20,17 @@
 #ifdef BOOST_HAS_THREADS
 # ifdef BOOST_MSVC
 # pragma warning( push )
-# pragma warning( disable: 4275 ) // non-dll class used as base for dll class
+ // "conditional expression is constant" in basic_timed_mutex.hpp
+# pragma warning( disable: 4127 )
+ // "conversion from 'int' to 'unsigned short'" in microsec_time_clock.hpp
+# pragma warning( disable: 4244 )
+ // "... needs to have dll-interface to be used by clients of class ..."
+# pragma warning( disable: 4251 )
+ // "... assignment operator could not be generated"
+# pragma warning( disable: 4512 )
+ // "Function call with parameters that may be unsafe" in
+ // condition_variable.hpp
+# pragma warning( disable: 4996 )
 # endif
 
 # include <boost/thread/mutex.hpp>

Modified: branches/fix-links/boost/statechart/in_state_reaction.hpp
==============================================================================
--- branches/fix-links/boost/statechart/in_state_reaction.hpp (original)
+++ branches/fix-links/boost/statechart/in_state_reaction.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,7 +1,7 @@
 #ifndef BOOST_STATECHART_IN_STATE_REACTION_HPP_INCLUDED
 #define BOOST_STATECHART_IN_STATE_REACTION_HPP_INCLUDED
 //////////////////////////////////////////////////////////////////////////////
-// Copyright 2005-2006 Andreas Huber Doenni
+// Copyright 2005-2008 Andreas Huber Doenni
 // Distributed under the Boost Software License, Version 1.0. (See accompany-
 // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 //////////////////////////////////////////////////////////////////////////////
@@ -10,10 +10,7 @@
 
 #include <boost/statechart/result.hpp>
 
-#include <boost/mpl/if.hpp>
-
-#include <boost/cast.hpp> // boost::polymorphic_downcast
-#include <boost/type_traits/is_same.hpp>
+#include <boost/statechart/detail/reaction_dispatcher.hpp>
 
 
 
@@ -27,40 +24,26 @@
 class event_base;
 
 //////////////////////////////////////////////////////////////////////////////
-template< class Event,
- class ReactionContext,
- void ( ReactionContext::*pAction )( const Event & ) >
+template< class Event,
+ class ReactionContext = detail::no_context< Event >,
+ void ( ReactionContext::*pAction )( const Event & ) =
+ &detail::no_context< Event >::no_function >
 class in_state_reaction
 {
   private:
     //////////////////////////////////////////////////////////////////////////
- struct react_base
+ template< class State >
+ struct reactions
     {
- template< class State, class EventBase, class IdType >
- static detail::reaction_result react(
- State & stt, const EventBase & evt, const IdType & )
+ static result react_without_action( State & stt )
       {
- ( stt.template context< ReactionContext >().*pAction )( evt );
- return detail::do_discard_event;
+ return stt.discard_event();
       }
- };
 
- struct react_derived
- {
- template< class State, class EventBase, class IdType >
- static detail::reaction_result react(
- State & stt, const EventBase & evt, const IdType & eventType )
+ static result react_with_action( State & stt, const Event & evt )
       {
- if ( eventType == Event::static_type() )
- {
- ( stt.template context< ReactionContext >().*pAction )(
- *polymorphic_downcast< const Event * >( &evt ) );
- return detail::do_discard_event;
- }
- else
- {
- return detail::no_reaction;
- }
+ ( stt.template context< ReactionContext >().*pAction )( evt );
+ return react_without_action( stt );
       }
     };
 
@@ -73,11 +56,10 @@
     static detail::reaction_result react(
       State & stt, const EventBase & evt, const IdType & eventType )
     {
- typedef typename mpl::if_<
- is_same< Event, event_base >, react_base, react_derived
- >::type impl;
-
- return impl::react( stt, evt, eventType );
+ typedef detail::reaction_dispatcher<
+ reactions< State >, State, EventBase, Event, ReactionContext, IdType
+ > dispatcher;
+ return dispatcher::react( stt, evt, eventType );
     }
 };
 

Modified: branches/fix-links/boost/statechart/processor_container.hpp
==============================================================================
--- branches/fix-links/boost/statechart/processor_container.hpp (original)
+++ branches/fix-links/boost/statechart/processor_container.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,7 +1,7 @@
 #ifndef BOOST_STATECHART_PROCESSOR_CONTAINER_HPP_INCLUDED
 #define BOOST_STATECHART_PROCESSOR_CONTAINER_HPP_INCLUDED
 //////////////////////////////////////////////////////////////////////////////
-// Copyright 2002-2006 Andreas Huber Doenni
+// Copyright 2002-2008 Andreas Huber Doenni
 // Distributed under the Boost Software License, Version 1.0. (See accompany-
 // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 //////////////////////////////////////////////////////////////////////////////
@@ -70,6 +70,9 @@
       private:
       #endif
 
+ // avoids C4512 (assignment operator could not be generated)
+ processor_context & operator=( const processor_context & );
+
         Scheduler & scheduler_;
         const processor_handle handle_;
 

Modified: branches/fix-links/boost/statechart/simple_state.hpp
==============================================================================
--- branches/fix-links/boost/statechart/simple_state.hpp (original)
+++ branches/fix-links/boost/statechart/simple_state.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,7 +1,7 @@
 #ifndef BOOST_STATECHART_SIMPLE_STATE_HPP_INCLUDED
 #define BOOST_STATECHART_SIMPLE_STATE_HPP_INCLUDED
 //////////////////////////////////////////////////////////////////////////////
-// Copyright 2002-2006 Andreas Huber Doenni
+// Copyright 2002-2008 Andreas Huber Doenni
 // Distributed under the Boost Software License, Version 1.0. (See accompany-
 // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 //////////////////////////////////////////////////////////////////////////////
@@ -128,6 +128,9 @@
     }
 
   private:
+ // avoids C4512 (assignment operator could not be generated)
+ transition_function & operator=( const transition_function & );
+
     void ( TransitionContext::*pTransitionAction_ )( const Event & );
     const Event & evt_;
 };

Modified: branches/fix-links/boost/statechart/state_machine.hpp
==============================================================================
--- branches/fix-links/boost/statechart/state_machine.hpp (original)
+++ branches/fix-links/boost/statechart/state_machine.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,7 +1,7 @@
 #ifndef BOOST_STATECHART_STATE_MACHINE_HPP_INCLUDED
 #define BOOST_STATECHART_STATE_MACHINE_HPP_INCLUDED
 //////////////////////////////////////////////////////////////////////////////
-// Copyright 2002-2006 Andreas Huber Doenni
+// Copyright 2002-2008 Andreas Huber Doenni
 // Distributed under the Boost Software License, Version 1.0. (See accompany-
 // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 //////////////////////////////////////////////////////////////////////////////
@@ -57,15 +57,6 @@
 
 
 
-#ifdef BOOST_MSVC
-// We permanently turn off the following level 4 warnings because users will
-// have to do so themselves anyway if we turn them back on
-# pragma warning( disable: 4511 ) // copy constructor could not be generated
-# pragma warning( disable: 4512 ) // assignment op could not be generated
-#endif
-
-
-
 namespace boost
 {
 namespace statechart
@@ -98,6 +89,9 @@
 
   private:
     //////////////////////////////////////////////////////////////////////////
+ // avoids C4512 (assignment operator could not be generated)
+ send_function & operator=( const send_function & );
+
     StateBaseType & toState_;
     const EventBaseType & evt_;
     IdType eventType_;
@@ -220,6 +214,9 @@
     {
     }
 
+ // avoids C4512 (assignment operator could not be generated)
+ history_key & operator=( const history_key & );
+
     const typename RttiPolicy::id_type historyContextType_;
     const orthogonal_position_type historizedOrthogonalRegion_;
 };
@@ -720,6 +717,10 @@
 
       private:
         //////////////////////////////////////////////////////////////////////
+ // avoids C4512 (assignment operator could not be generated)
+ initial_construct_function & operator=(
+ const initial_construct_function & );
+
         state_machine & machine_;
     };
     friend class initial_construct_function;
@@ -739,6 +740,9 @@
 
       private:
         //////////////////////////////////////////////////////////////////////
+ // avoids C4512 (assignment operator could not be generated)
+ terminate_function & operator=( const terminate_function & );
+
         state_machine & machine_;
     };
     friend class terminate_function;
@@ -814,6 +818,10 @@
 
       private:
         //////////////////////////////////////////////////////////////////////
+ // avoids C4512 (assignment operator could not be generated)
+ exception_event_handler & operator=(
+ const exception_event_handler & );
+
         state_machine & machine_;
         state_base_type * pCurrentState_;
     };
@@ -822,6 +830,7 @@
     class terminator
     {
       public:
+ //////////////////////////////////////////////////////////////////////
         terminator( state_machine & machine ) :
           machine_( machine ), dismissed_( false ) {}
         ~terminator()
@@ -831,6 +840,10 @@
         void dismiss() { dismissed_ = true; }
 
       private:
+ //////////////////////////////////////////////////////////////////////
+ // avoids C4512 (assignment operator could not be generated)
+ terminator & operator=( const terminator & );
+
         state_machine & machine_;
         bool dismissed_;
     };

Modified: branches/fix-links/boost/statechart/transition.hpp
==============================================================================
--- branches/fix-links/boost/statechart/transition.hpp (original)
+++ branches/fix-links/boost/statechart/transition.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,7 +1,7 @@
 #ifndef BOOST_STATECHART_TRANSITION_HPP_INCLUDED
 #define BOOST_STATECHART_TRANSITION_HPP_INCLUDED
 //////////////////////////////////////////////////////////////////////////////
-// Copyright 2002-2006 Andreas Huber Doenni
+// Copyright 2002-2008 Andreas Huber Doenni
 // Distributed under the Boost Software License, Version 1.0. (See accompany-
 // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 //////////////////////////////////////////////////////////////////////////////
@@ -10,10 +10,7 @@
 
 #include <boost/statechart/result.hpp>
 
-#include <boost/mpl/if.hpp>
-
-#include <boost/cast.hpp> // boost::polymorphic_downcast
-#include <boost/type_traits/is_same.hpp>
+#include <boost/statechart/detail/reaction_dispatcher.hpp>
 
 
 
@@ -21,27 +18,10 @@
 {
 namespace statechart
 {
-namespace detail
-{
 
 
 
 //////////////////////////////////////////////////////////////////////////////
-template< class Event >
-struct no_context
-{
- void no_function( const Event & );
-};
-
-
-
-} // namespace detail
-
-
-
-class event_base;
-
-//////////////////////////////////////////////////////////////////////////////
 template< class Event, class Destination,
           class TransitionContext = detail::no_context< Event >,
           void ( TransitionContext::*pTransitionAction )( const Event & ) =
@@ -50,74 +30,17 @@
 {
   private:
     //////////////////////////////////////////////////////////////////////////
- struct react_without_transition_action_impl
- {
- template< class State, class EventBase >
- static detail::reaction_result react( State & stt, const EventBase & )
- {
- return detail::result_utility::get_result(
- stt.template transit< Destination >() );
- }
- };
-
- struct react_base_with_transition_action_impl
+ template< class State >
+ struct reactions
     {
- template< class State, class EventBase >
- static detail::reaction_result react(
- State & stt, const EventBase & toEvent )
+ static result react_without_action( State & stt )
       {
- return detail::result_utility::get_result(
- stt.template transit< Destination >( pTransitionAction, toEvent ) );
+ return stt.template transit< Destination >();
       }
- };
 
- struct react_base
- {
- template< class State, class EventBase, class IdType >
- static detail::reaction_result react(
- State & stt, const EventBase & evt, const IdType & )
+ static result react_with_action( State & stt, const Event & evt )
       {
- typedef typename mpl::if_<
- is_same< TransitionContext, detail::no_context< Event > >,
- react_without_transition_action_impl,
- react_base_with_transition_action_impl
- >::type impl;
- return impl::react( stt, evt );
- }
- };
-
- struct react_derived_with_transition_action_impl
- {
- template< class State, class EventBase >
- static detail::reaction_result react(
- State & stt, const EventBase & toEvent )
- {
- return detail::result_utility::get_result(
- stt.template transit< Destination >(
- pTransitionAction,
- *polymorphic_downcast< const Event * >( &toEvent ) ) );
- }
- };
-
- struct react_derived
- {
- template< class State, class EventBase, class IdType >
- static detail::reaction_result react(
- State & stt, const EventBase & evt, const IdType & eventType )
- {
- if ( eventType == Event::static_type() )
- {
- typedef typename mpl::if_<
- is_same< TransitionContext, detail::no_context< Event > >,
- react_without_transition_action_impl,
- react_derived_with_transition_action_impl
- >::type impl;
- return impl::react( stt, evt );
- }
- else
- {
- return detail::no_reaction;
- }
+ return stt.template transit< Destination >( pTransitionAction, evt );
       }
     };
 
@@ -130,11 +53,10 @@
     static detail::reaction_result react(
       State & stt, const EventBase & evt, const IdType & eventType )
     {
- typedef typename mpl::if_<
- is_same< Event, event_base >, react_base, react_derived
- >::type impl;
-
- return impl::react( stt, evt, eventType );
+ typedef detail::reaction_dispatcher<
+ reactions< State >, State, EventBase, Event, TransitionContext, IdType
+ > dispatcher;
+ return dispatcher::react( stt, evt, eventType );
     }
 };
 

Modified: branches/fix-links/boost/test/impl/debug.ipp
==============================================================================
--- branches/fix-links/boost/test/impl/debug.ipp (original)
+++ branches/fix-links/boost/test/impl/debug.ipp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -32,6 +32,7 @@
 # include <windows.h>
 # include <winreg.h>
 # include <cstdio>
+# include <cstring>
 
 # if !defined(NDEBUG) && defined(_MSC_VER)
 # define BOOST_MS_CRT_BASED_DEBUG
@@ -58,6 +59,7 @@
 // STL
 #include <cstring>
 #include <map>
+#include <cstdio>
 #include <stdarg.h> // !! ?? cstdarg
 
 // SYSTEM API
@@ -964,3 +966,4 @@
 #include <boost/test/detail/enable_warnings.hpp>
 
 #endif // BOOST_TEST_DEBUG_API_IPP_112006GER
+

Modified: branches/fix-links/boost/test/impl/execution_monitor.ipp
==============================================================================
--- branches/fix-links/boost/test/impl/execution_monitor.ipp (original)
+++ branches/fix-links/boost/test/impl/execution_monitor.ipp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -65,7 +65,7 @@
 
 # include <windows.h>
 
-# if defined(__MWERKS__)
+# if defined(__MWERKS__) || defined(BOOST_MSVC)
 # include <eh.h>
 # endif
 
@@ -1149,3 +1149,4 @@
 #include <boost/test/detail/enable_warnings.hpp>
 
 #endif // BOOST_TEST_EXECUTION_MONITOR_IPP_012205GER
+

Modified: branches/fix-links/boost/test/test_tools.hpp
==============================================================================
--- branches/fix-links/boost/test/test_tools.hpp (original)
+++ branches/fix-links/boost/test/test_tools.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -377,6 +377,16 @@
 //____________________________________________________________________________//
 
 template<>
+struct BOOST_TEST_DECL print_log_value<bool> {
+ void operator()( std::ostream& ostr, bool t )
+ {
+ ostr << std::boolalpha << t;
+ }
+};
+
+//____________________________________________________________________________//
+
+template<>
 struct BOOST_TEST_DECL print_log_value<char> {
     void operator()( std::ostream& ostr, char t );
 };

Modified: branches/fix-links/boost/thread/win32/once.hpp
==============================================================================
--- branches/fix-links/boost/thread/win32/once.hpp (original)
+++ branches/fix-links/boost/thread/win32/once.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -94,9 +94,9 @@
             detail::int_to_string(win32::GetCurrentProcessId(), mutex_name + once_mutex_name_fixed_length + sizeof(void*)*2);
 
 #ifdef BOOST_NO_ANSI_APIS
- return win32::CreateMutexW(NULL, 0, mutex_name);
+ return win32::CreateMutexW(0, 0, mutex_name);
 #else
- return win32::CreateMutexA(NULL, 0, mutex_name);
+ return win32::CreateMutexA(0, 0, mutex_name);
 #endif
         }
 

Modified: branches/fix-links/boost/thread/win32/shared_mutex.hpp
==============================================================================
--- branches/fix-links/boost/thread/win32/shared_mutex.hpp (original)
+++ branches/fix-links/boost/thread/win32/shared_mutex.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -57,12 +57,12 @@
         {
             if(old_state.exclusive_waiting)
             {
- BOOST_VERIFY(detail::win32::ReleaseSemaphore(exclusive_sem,1,NULL)!=0);
+ BOOST_VERIFY(detail::win32::ReleaseSemaphore(exclusive_sem,1,0)!=0);
             }
                         
             if(old_state.shared_waiting || old_state.exclusive_waiting)
             {
- BOOST_VERIFY(detail::win32::ReleaseSemaphore(unlock_sem,old_state.shared_waiting + (old_state.exclusive_waiting?1:0),NULL)!=0);
+ BOOST_VERIFY(detail::win32::ReleaseSemaphore(unlock_sem,old_state.shared_waiting + (old_state.exclusive_waiting?1:0),0)!=0);
             }
         }
         
@@ -215,7 +215,7 @@
                     {
                         if(old_state.upgrade)
                         {
- BOOST_VERIFY(detail::win32::ReleaseSemaphore(upgrade_sem,1,NULL)!=0);
+ BOOST_VERIFY(detail::win32::ReleaseSemaphore(upgrade_sem,1,0)!=0);
                         }
                         else
                         {

Modified: branches/fix-links/boost/thread/win32/thread_primitives.hpp
==============================================================================
--- branches/fix-links/boost/thread/win32/thread_primitives.hpp (original)
+++ branches/fix-links/boost/thread/win32/thread_primitives.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -181,9 +181,9 @@
             inline handle create_anonymous_semaphore(long initial_count,long max_count)
             {
 #if !defined(BOOST_NO_ANSI_APIS)
- handle const res=CreateSemaphoreA(NULL,initial_count,max_count,NULL);
+ handle const res=CreateSemaphoreA(0,initial_count,max_count,0);
 #else
- handle const res=CreateSemaphoreW(NULL,initial_count,max_count,NULL);
+ handle const res=CreateSemaphoreW(0,initial_count,max_count,0);
 #endif
                 if(!res)
                 {

Modified: branches/fix-links/boost/tr1/detail/config.hpp
==============================================================================
--- branches/fix-links/boost/tr1/detail/config.hpp (original)
+++ branches/fix-links/boost/tr1/detail/config.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -112,13 +112,34 @@
 #if defined(_MSC_VER) && (_MSC_VER >= 1500) \
    && defined(_MSC_FULL_VER) && \
    !defined(__SGI_STL_PORT) && \
- !defined(_STLPORT_VERSION)
+ !defined(_STLPORT_VERSION) && \
+ !defined(_RWSTD_VER_STR) && \
+ !defined(_RWSTD_VER)
 //
 // MSVC-9.0 defines a not-quite TR1 conforming hash
 // function object in <functional>, so we must define
-// this here:
+// this here, in addition the feature pack for VC9
+// provides a more or less full TR1 implementation:
 //
+#if defined(_HAS_TR1) && (_HAS_TR1 + 0)
+# define BOOST_HAS_TR1_ARRAY
+# define BOOST_HAS_TR1_REFERENCE_WRAPPER
+# define BOOST_HAS_TR1_RESULT_OF
+# define BOOST_HAS_TR1_MEM_FN
+# define BOOST_HAS_TR1_BIND
+# define BOOST_HAS_TR1_FUNCTION
 # define BOOST_HAS_TR1_HASH
+# define BOOST_HAS_TR1_SHARED_PTR
+# define BOOST_HAS_TR1_RANDOM
+# define BOOST_HAS_TR1_REGEX
+# define BOOST_HAS_TR1_TUPLE
+# define BOOST_HAS_TR1_TYPE_TRAITS
+# define BOOST_HAS_TR1_UTILITY
+# define BOOST_HAS_TR1_UNORDERED_MAP
+# define BOOST_HAS_TR1_UNORDERED_SET
+#else
+# define BOOST_HAS_TR1_HASH
+#endif
 #endif
 
 #include <boost/config.hpp>

Modified: branches/fix-links/boost/type_traits/make_signed.hpp
==============================================================================
--- branches/fix-links/boost/type_traits/make_signed.hpp (original)
+++ branches/fix-links/boost/type_traits/make_signed.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -72,7 +72,7 @@
                      is_same<t_no_cv, unsigned long>,
                      long,
 #if defined(BOOST_HAS_LONG_LONG)
- long long
+ boost::long_long_type
 #elif defined(BOOST_HAS_MS_INT64)
                      __int64
 #else
@@ -96,7 +96,7 @@
                      sizeof(t_no_cv) == sizeof(unsigned long),
                      long,
 #if defined(BOOST_HAS_LONG_LONG)
- long long
+ boost::long_long_type
 #elif defined(BOOST_HAS_MS_INT64)
                      __int64
 #else

Modified: branches/fix-links/boost/type_traits/make_unsigned.hpp
==============================================================================
--- branches/fix-links/boost/type_traits/make_unsigned.hpp (original)
+++ branches/fix-links/boost/type_traits/make_unsigned.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -72,7 +72,7 @@
                      is_same<t_no_cv, long>,
                      unsigned long,
 #if defined(BOOST_HAS_LONG_LONG)
- unsigned long long
+ boost::ulong_long_type
 #elif defined(BOOST_HAS_MS_INT64)
                      unsigned __int64
 #else
@@ -96,7 +96,7 @@
                      sizeof(t_no_cv) == sizeof(unsigned long),
                      unsigned long,
 #if defined(BOOST_HAS_LONG_LONG)
- unsigned long long
+ boost::ulong_long_type
 #elif defined(BOOST_HAS_MS_INT64)
                      unsigned __int64
 #else

Modified: branches/fix-links/boost/utility/value_init.hpp
==============================================================================
--- branches/fix-links/boost/utility/value_init.hpp (original)
+++ branches/fix-links/boost/utility/value_init.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -1,31 +1,20 @@
-// (C) Copyright 2002-2007, Fernando Luis Cacciola Carballal.
+// (C) Copyright 2002-2008, Fernando Luis Cacciola Carballal.
 //
 // 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)
 //
 // 21 Ago 2002 (Created) Fernando Cacciola
-// 24 Dec 2007 (Refactored and worked around various compiler bugs) Fernando Cacciola, Niels Dekker
+// 19 Jan 2008 (Worked around compiler bugs, added initialized_value) Fernando Cacciola, Niels Dekker
 //
 #ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
 #define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
 
 // Note: The implementation of boost::value_initialized had to deal with the
-// fact that various compilers haven't fully implemented value-initialization:
-// Microsoft Feedback ID 100744 - Value-initialization in new-expression
-// Reported by Pavel Kuznetsov (MetaCommunications Engineering), 2005-07-28
-// https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=100744
-// GCC Bug 30111 - Value-initialization of POD base class doesn't initialize members
-// Reported by Jonathan Wakely, 2006-12-07
-// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30111
-// GCC Bug 33916 - Default constructor fails to initialize array members
-// Reported by Michael Elizabeth Chastain, 2007-10-26
-// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33916
-// Borland Report 51854 - Value-initialization: POD struct should be zero-initialized
-// Reported by Niels Dekker (LKEB, Leiden University Medical Center), 2007-11-09
-// http://qc.codegear.com/wc/qcmain.aspx?d=51854
-// The constructor of boost::value_initialized<T> works around these issues, by
-// clearing the bytes of T, before constructing the T object it contains.
+// fact that various compilers haven't fully implemented value-initialization.
+// The constructor of boost::value_initialized<T> works around these compiler
+// issues, by clearing the bytes of T, before constructing the T object it
+// contains. More details on these issues are at libs/utility/value_init.htm
 
 #include <boost/aligned_storage.hpp>
 #include <boost/detail/workaround.hpp>
@@ -60,7 +49,7 @@
 #if _MSC_VER >= 1310
 // When using MSVC 7.1 or higher, the following placement new expression may trigger warning C4345:
 // "behavior change: an object of POD type constructed with an initializer of the form ()
-// will be default-initialized". There is no need to worry about this, though.
+// will be default-initialized". It is safe to ignore this warning when using value_initialized.
 #pragma warning(disable: 4345)
 #endif
 #endif
@@ -77,9 +66,8 @@
 
     value_initialized & operator=(value_initialized const & arg)
     {
- T & this_data = this->data();
       T const & arg_data = arg.data();
- this_data = arg_data;
+ this->data() = arg_data;
       return *this;
     }
 
@@ -110,6 +98,18 @@
   return x.data() ;
 }
 
+
+class initialized_value
+{
+ public :
+
+ template <class T> operator T() const
+ {
+ return get( value_initialized<T>() );
+ }
+};
+
+
 } // namespace boost
 
 

Modified: branches/fix-links/boost/wave.hpp
==============================================================================
--- branches/fix-links/boost/wave.hpp (original)
+++ branches/fix-links/boost/wave.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -5,7 +5,7 @@
 
     See http://www.boost.org/libs/wave for documentation
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/cpp_context.hpp
==============================================================================
--- branches/fix-links/boost/wave/cpp_context.hpp (original)
+++ branches/fix-links/boost/wave/cpp_context.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -4,7 +4,7 @@
     
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/
@@ -50,7 +50,7 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 //
-// The C preprocessor context template class
+// The C/C++ preprocessor context template class
 //
 // The boost::wave::context template is the main interface class to
 // control the behavior of the preprocessing engine.

Modified: branches/fix-links/boost/wave/cpp_exceptions.hpp
==============================================================================
--- branches/fix-links/boost/wave/cpp_exceptions.hpp (original)
+++ branches/fix-links/boost/wave/cpp_exceptions.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/cpp_iteration_context.hpp
==============================================================================
--- branches/fix-links/boost/wave/cpp_iteration_context.hpp (original)
+++ branches/fix-links/boost/wave/cpp_iteration_context.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -4,7 +4,7 @@
     
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/cpp_throw.hpp
==============================================================================
--- branches/fix-links/boost/wave/cpp_throw.hpp (original)
+++ branches/fix-links/boost/wave/cpp_throw.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/cpplexer/convert_trigraphs.hpp
==============================================================================
--- branches/fix-links/boost/wave/cpplexer/convert_trigraphs.hpp (original)
+++ branches/fix-links/boost/wave/cpplexer/convert_trigraphs.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -5,7 +5,7 @@
     
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/cpplexer/cpp_lex_interface.hpp
==============================================================================
--- branches/fix-links/boost/wave/cpplexer/cpp_lex_interface.hpp (original)
+++ branches/fix-links/boost/wave/cpplexer/cpp_lex_interface.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -5,7 +5,7 @@
     
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/cpplexer/cpp_lex_interface_generator.hpp
==============================================================================
--- branches/fix-links/boost/wave/cpplexer/cpp_lex_interface_generator.hpp (original)
+++ branches/fix-links/boost/wave/cpplexer/cpp_lex_interface_generator.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -5,7 +5,7 @@
     
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/cpplexer/cpp_lex_iterator.hpp
==============================================================================
--- branches/fix-links/boost/wave/cpplexer/cpp_lex_iterator.hpp (original)
+++ branches/fix-links/boost/wave/cpplexer/cpp_lex_iterator.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -5,7 +5,7 @@
     
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/cpplexer/cpp_lex_token.hpp
==============================================================================
--- branches/fix-links/boost/wave/cpplexer/cpp_lex_token.hpp (original)
+++ branches/fix-links/boost/wave/cpplexer/cpp_lex_token.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -5,7 +5,7 @@
     
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/cpplexer/cpplexer_exceptions.hpp
==============================================================================
--- branches/fix-links/boost/wave/cpplexer/cpplexer_exceptions.hpp (original)
+++ branches/fix-links/boost/wave/cpplexer/cpplexer_exceptions.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/cpplexer/detect_include_guards.hpp
==============================================================================
--- branches/fix-links/boost/wave/cpplexer/detect_include_guards.hpp (original)
+++ branches/fix-links/boost/wave/cpplexer/detect_include_guards.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -22,7 +22,7 @@
     will work as well). The code allows for any whitespace, newline and single
     '#' tokens before the #if/#ifndef and after the final #endif.
     
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/cpplexer/re2clex/aq.hpp
==============================================================================
--- branches/fix-links/boost/wave/cpplexer/re2clex/aq.hpp (original)
+++ branches/fix-links/boost/wave/cpplexer/re2clex/aq.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -4,7 +4,7 @@
     http://www.boost.org/
     
     Copyright (c) 2001 Daniel C. Nuffer.
- Copyright (c) 2001-2007 Hartmut Kaiser.
+ Copyright (c) 2001-2008 Hartmut Kaiser.
     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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/cpplexer/re2clex/cpp_re.hpp
==============================================================================
--- branches/fix-links/boost/wave/cpplexer/re2clex/cpp_re.hpp (original)
+++ branches/fix-links/boost/wave/cpplexer/re2clex/cpp_re.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -5,7 +5,7 @@
     
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp
==============================================================================
--- branches/fix-links/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp (original)
+++ branches/fix-links/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -5,7 +5,7 @@
     
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/cpplexer/re2clex/scanner.hpp
==============================================================================
--- branches/fix-links/boost/wave/cpplexer/re2clex/scanner.hpp (original)
+++ branches/fix-links/boost/wave/cpplexer/re2clex/scanner.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -4,7 +4,7 @@
     http://www.boost.org/
     
     Copyright (c) 2001 Daniel C. Nuffer.
- Copyright (c) 2001-2007 Hartmut Kaiser.
+ Copyright (c) 2001-2008 Hartmut Kaiser.
     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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/cpplexer/token_cache.hpp
==============================================================================
--- branches/fix-links/boost/wave/cpplexer/token_cache.hpp (original)
+++ branches/fix-links/boost/wave/cpplexer/token_cache.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/cpplexer/validate_universal_char.hpp
==============================================================================
--- branches/fix-links/boost/wave/cpplexer/validate_universal_char.hpp (original)
+++ branches/fix-links/boost/wave/cpplexer/validate_universal_char.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -5,7 +5,7 @@
     
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/grammars/cpp_chlit_grammar.hpp
==============================================================================
--- branches/fix-links/boost/wave/grammars/cpp_chlit_grammar.hpp (original)
+++ branches/fix-links/boost/wave/grammars/cpp_chlit_grammar.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/grammars/cpp_defined_grammar.hpp
==============================================================================
--- branches/fix-links/boost/wave/grammars/cpp_defined_grammar.hpp (original)
+++ branches/fix-links/boost/wave/grammars/cpp_defined_grammar.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/grammars/cpp_defined_grammar_gen.hpp
==============================================================================
--- branches/fix-links/boost/wave/grammars/cpp_defined_grammar_gen.hpp (original)
+++ branches/fix-links/boost/wave/grammars/cpp_defined_grammar_gen.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/grammars/cpp_expression_grammar.hpp
==============================================================================
--- branches/fix-links/boost/wave/grammars/cpp_expression_grammar.hpp (original)
+++ branches/fix-links/boost/wave/grammars/cpp_expression_grammar.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/grammars/cpp_expression_grammar_gen.hpp
==============================================================================
--- branches/fix-links/boost/wave/grammars/cpp_expression_grammar_gen.hpp (original)
+++ branches/fix-links/boost/wave/grammars/cpp_expression_grammar_gen.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/grammars/cpp_expression_value.hpp
==============================================================================
--- branches/fix-links/boost/wave/grammars/cpp_expression_value.hpp (original)
+++ branches/fix-links/boost/wave/grammars/cpp_expression_value.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/grammars/cpp_grammar.hpp
==============================================================================
--- branches/fix-links/boost/wave/grammars/cpp_grammar.hpp (original)
+++ branches/fix-links/boost/wave/grammars/cpp_grammar.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/grammars/cpp_grammar_gen.hpp
==============================================================================
--- branches/fix-links/boost/wave/grammars/cpp_grammar_gen.hpp (original)
+++ branches/fix-links/boost/wave/grammars/cpp_grammar_gen.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/grammars/cpp_intlit_grammar.hpp
==============================================================================
--- branches/fix-links/boost/wave/grammars/cpp_intlit_grammar.hpp (original)
+++ branches/fix-links/boost/wave/grammars/cpp_intlit_grammar.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/grammars/cpp_literal_grammar_gen.hpp
==============================================================================
--- branches/fix-links/boost/wave/grammars/cpp_literal_grammar_gen.hpp (original)
+++ branches/fix-links/boost/wave/grammars/cpp_literal_grammar_gen.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/grammars/cpp_predef_macros_gen.hpp
==============================================================================
--- branches/fix-links/boost/wave/grammars/cpp_predef_macros_gen.hpp (original)
+++ branches/fix-links/boost/wave/grammars/cpp_predef_macros_gen.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/grammars/cpp_predef_macros_grammar.hpp
==============================================================================
--- branches/fix-links/boost/wave/grammars/cpp_predef_macros_grammar.hpp (original)
+++ branches/fix-links/boost/wave/grammars/cpp_predef_macros_grammar.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/grammars/cpp_value_error.hpp
==============================================================================
--- branches/fix-links/boost/wave/grammars/cpp_value_error.hpp (original)
+++ branches/fix-links/boost/wave/grammars/cpp_value_error.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/language_support.hpp
==============================================================================
--- branches/fix-links/boost/wave/language_support.hpp (original)
+++ branches/fix-links/boost/wave/language_support.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -4,7 +4,7 @@
     
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/preprocessing_hooks.hpp
==============================================================================
--- branches/fix-links/boost/wave/preprocessing_hooks.hpp (original)
+++ branches/fix-links/boost/wave/preprocessing_hooks.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -3,7 +3,7 @@
 
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/

Modified: branches/fix-links/boost/wave/token_ids.hpp
==============================================================================
--- branches/fix-links/boost/wave/token_ids.hpp (original)
+++ branches/fix-links/boost/wave/token_ids.hpp 2008-01-21 15:15:02 EST (Mon, 21 Jan 2008)
@@ -5,7 +5,7 @@
     
     http://www.boost.org/
 
- Copyright (c) 2001-2007 Hartmut Kaiser. Distributed under the Boost
+ Copyright (c) 2001-2008 Hartmut Kaiser. 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)
 =============================================================================*/
@@ -167,125 +167,124 @@
     T_CONSTCAST = TOKEN_FROM_ID(316, KeywordTokenType),
     T_CONTINUE = TOKEN_FROM_ID(317, KeywordTokenType),
     T_DEFAULT = TOKEN_FROM_ID(318, KeywordTokenType),
- T_DEFINED = TOKEN_FROM_ID(319, KeywordTokenType),
- T_DELETE = TOKEN_FROM_ID(320, KeywordTokenType),
- T_DO = TOKEN_FROM_ID(321, KeywordTokenType),
- T_DOUBLE = TOKEN_FROM_ID(322, KeywordTokenType),
- T_DYNAMICCAST = TOKEN_FROM_ID(323, KeywordTokenType),
- T_ELSE = TOKEN_FROM_ID(324, KeywordTokenType),
- T_ENUM = TOKEN_FROM_ID(325, KeywordTokenType),
- T_EXPLICIT = TOKEN_FROM_ID(326, KeywordTokenType),
- T_EXPORT = TOKEN_FROM_ID(327, KeywordTokenType),
- T_EXTERN = TOKEN_FROM_ID(328, KeywordTokenType),
- T_FLOAT = TOKEN_FROM_ID(329, KeywordTokenType),
- T_FOR = TOKEN_FROM_ID(330, KeywordTokenType),
- T_FRIEND = TOKEN_FROM_ID(331, KeywordTokenType),
- T_GOTO = TOKEN_FROM_ID(332, KeywordTokenType),
- T_IF = TOKEN_FROM_ID(333, KeywordTokenType),
- T_INLINE = TOKEN_FROM_ID(334, KeywordTokenType),
- T_INT = TOKEN_FROM_ID(335, KeywordTokenType),
- T_LONG = TOKEN_FROM_ID(336, KeywordTokenType),
- T_MUTABLE = TOKEN_FROM_ID(337, KeywordTokenType),
- T_NAMESPACE = TOKEN_FROM_ID(338, KeywordToken