/usr/include/boost/interprocess/detail
NameSizeModeActions
atomic.hpp220360644editdlrm
cast_tags.hpp9590644editdlrm
config_begin.hpp32100644editdlrm
config_end.hpp5640644editdlrm
config_external_begin.hpp7140644editdlrm
config_external_end.hpp5290644editdlrm
file_locking_helpers.hpp70290644editdlrm
file_wrapper.hpp64070644editdlrm
intermodule_singleton.hpp16340644editdlrm
intermodule_singleton_common.hpp200680644editdlrm
interprocess_tester.hpp10280644editdlrm
intersegment_ptr.hpp343010644editdlrm
in_place_interface.hpp22840644editdlrm
managed_global_memory.hpp40720644editdlrm
managed_memory_impl.hpp300590644editdlrm
managed_multi_shared_memory.hpp147440644editdlrm
managed_open_or_create_impl.hpp154210644editdlrm
math_functions.hpp25740644editdlrm
min_max.hpp11470644editdlrm
move.hpp8790644editdlrm
mpl.hpp22590644editdlrm
named_proxy.hpp99500644editdlrm
nothrow.hpp11990644editdlrm
os_file_functions.hpp224340644editdlrm
os_thread_functions.hpp174400644editdlrm
pointer_type.hpp18900644editdlrm
portable_intermodule_singleton.hpp116700644editdlrm
posix_time_types_wrk.hpp14590644editdlrm
ptime_wrk.hpp11950644editdlrm
robust_emulation.hpp130200644editdlrm
segment_manager_helper.hpp153250644editdlrm
shared_dir_helpers.hpp69080644editdlrm
simple_swap.hpp8590644editdlrm
std_fwd.hpp17080644editdlrm
transform_iterator.hpp12830644editdlrm
type_traits.hpp29010644editdlrm
utilities.hpp59170644editdlrm
variadic_templates_tools.hpp11150644editdlrm
win32_api.hpp614660644editdlrm
windows_intermodule_singleton.hpp107450644editdlrm
workaround.hpp91350644editdlrm
xsi_shared_memory_file_wrapper.hpp31440644editdlrm
Edit: /usr/include/boost/interprocess/detail/math_functions.hpp (2574B)
////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Stephen Cleary 2000. // (C) Copyright Ion Gaztanaga 2007-2012. // // 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. // // This file is a slightly modified file from Boost.Pool // ////////////////////////////////////////////////////////////////////////////// #ifndef BOOST_INTERPROCESS_DETAIL_MATH_FUNCTIONS_HPP #define BOOST_INTERPROCESS_DETAIL_MATH_FUNCTIONS_HPP #ifndef BOOST_CONFIG_HPP # include #endif # #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif #include #include namespace boost { namespace interprocess { namespace ipcdetail { // Greatest common divisor and least common multiple // // gcd is an algorithm that calculates the greatest common divisor of two // integers, using Euclid's algorithm. // // Pre: A > 0 && B > 0 // Recommended: A > B template inline Integer gcd(Integer A, Integer B) { do { const Integer tmp(B); B = A % B; A = tmp; } while (B != 0); return A; } // // lcm is an algorithm that calculates the least common multiple of two // integers. // // Pre: A > 0 && B > 0 // Recommended: A > B template inline Integer lcm(const Integer & A, const Integer & B) { Integer ret = A; ret /= gcd(A, B); ret *= B; return ret; } template inline Integer log2_ceil(const Integer & A) { Integer i = 0; Integer power_of_2 = 1; while(power_of_2 < A){ power_of_2 <<= 1; ++i; } return i; } template inline Integer upper_power_of_2(const Integer & A) { Integer power_of_2 = 1; while(power_of_2 < A){ power_of_2 <<= 1; } return power_of_2; } //This function uses binary search to discover the //highest set bit of the integer inline std::size_t floor_log2 (std::size_t x) { const std::size_t Bits = sizeof(std::size_t)*CHAR_BIT; const bool Size_t_Bits_Power_2= !(Bits & (Bits-1)); BOOST_STATIC_ASSERT(((Size_t_Bits_Power_2)== true)); std::size_t n = x; std::size_t log2 = 0; for(std::size_t shift = Bits >> 1; shift; shift >>= 1){ std::size_t tmp = n >> shift; if (tmp) log2 += shift, n = tmp; } return log2; } } // namespace ipcdetail } // namespace interprocess } // namespace boost #endif