Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
igaztanaga committed Feb 17, 2017
2 parents d6b3698 + 4178baf commit 541d428
Show file tree
Hide file tree
Showing 12 changed files with 527 additions and 131 deletions.
17 changes: 16 additions & 1 deletion doc/interprocess.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -6754,6 +6754,21 @@ thank them:

[section:release_notes Release Notes]

[section:release_notes_boost_1_64_00 Boost 1.64 Release]
* Fixed bugs:
* [@https://svn.boost.org/trac/boost/ticket/12617 Trac #12617 (['"clock_gettime not available on OS X 10.11"])].
* [@https://svn.boost.org/trac/boost/ticket/12744 Trac #12744 (['"winapi::set_timer_resolution inadvertently changes timer resolution (Windows)"])].
* [@https://github.com/boostorg/interprocess/pull/32 GitHub Pull #32 (['"Conform to std::pointer_traits requirements"])].
* [@https://github.com/boostorg/interprocess/pull/33 GitHub Pull #33 (['"explicit cast to derived class" and "64/32 bit processes sharing"])].
* [@https://github.com/boostorg/interprocess/pull/34 GitHub Pull #34 (['"Update example to use multi_index::member instead of BOOST_MULTI_INDEX_MEMBER"])].
* [@https://github.com/boostorg/interprocess/pull/35 GitHub Pull #35 (['"Fixed options for cross-compilation"])].

* New experimental option `BOOST_INTERPROCESS_BOOTSTAMP_IS_SESSION_MANAGER_BASED` from Windows systems.
This option derives the unique booststamp used to name the folder where shared memory is placed from registry values associated
with the session manager. This option only works on Vista and later systems and might be more stable than the default version.

[endsect]

[section:release_notes_boost_1_63_00 Boost 1.63 Release]
* Fixed bugs:
* [@https://svn.boost.org/trac/boost/ticket/12499 Trac #12499 (['"Memory allocation fails"])].
Expand All @@ -6770,7 +6785,7 @@ thank them:

[section:release_notes_boost_1_61_00 Boost 1.61 Release]
* Fixed bugs:
* [@https://github.com/boostorg/interprocess/pull/23 GitHub Pull #23 (['"Fixed case sensetive for linux mingw"])].
* [@https://github.com/boostorg/interprocess/pull/23 GitHub Pull #23 (['"Fixed case sensitive for linux mingw"])].

[endsect]

Expand Down
12 changes: 6 additions & 6 deletions example/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ rule test_all
<toolset>acc:<linkflags>-lrt
<toolset>acc-pa_risc:<linkflags>-lrt
<toolset>gcc,<target-os>windows:<linkflags>"-lole32 -loleaut32 -lpsapi -ladvapi32"
<host-os>hpux,<toolset>gcc:<linkflags>"-Wl,+as,mpas"
<host-os>windows,<toolset>clang:<linkflags>"-lole32 -loleaut32 -lpsapi -ladvapi32"
<host-os>linux:<linkflags>"-lrt"
<target-os>hpux,<toolset>gcc:<linkflags>"-Wl,+as,mpas"
<target-os>windows,<toolset>clang:<linkflags>"-lole32 -loleaut32 -lpsapi -ladvapi32"
<target-os>linux:<linkflags>"-lrt"
: # test-files
: # requirements
] ;
Expand All @@ -43,9 +43,9 @@ rule test_all
<toolset>acc:<linkflags>-lrt
<toolset>acc-pa_risc:<linkflags>-lrt
<toolset>gcc-mingw:<linkflags>"-lole32 -loleaut32 -lpsapi -ladvapi32"
<host-os>hpux,<toolset>gcc:<linkflags>"-Wl,+as,mpas"
<host-os>windows,<toolset>clang:<linkflags>"-lole32 -loleaut32 -lpsapi -ladvapi32"
<host-os>linux:<linkflags>"-lrt"
<target-os>hpux,<toolset>gcc:<linkflags>"-Wl,+as,mpas"
<target-os>windows,<toolset>clang:<linkflags>"-lole32 -loleaut32 -lpsapi -ladvapi32"
<target-os>linux:<linkflags>"-lrt"
] ;
}

Expand Down
6 changes: 3 additions & 3 deletions example/doc_multi_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ typedef bmi::multi_index_container<
employee,
bmi::indexed_by<
bmi::ordered_unique
<bmi::tag<id>, BOOST_MULTI_INDEX_MEMBER(employee,int,id)>,
<bmi::tag<id>, bmi::member<employee,int,&employee::id> >,
bmi::ordered_non_unique<
bmi::tag<name>,BOOST_MULTI_INDEX_MEMBER(employee,shm_string,name)>,
bmi::tag<name>, bmi::member<employee,shm_string,&employee::name> >,
bmi::ordered_non_unique
<bmi::tag<age>, BOOST_MULTI_INDEX_MEMBER(employee,int,age)> >,
<bmi::tag<age>, bmi::member<employee,int,&employee::age> > >,
managed_shared_memory::allocator<employee>::type
> employee_set;

Expand Down
6 changes: 6 additions & 0 deletions include/boost/interprocess/detail/os_file_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ inline file_handle_t file_handle_from_mapping_handle(mapping_handle_t hnd)
inline bool create_directory(const char *path)
{ return winapi::create_directory(path); }

inline bool remove_directory(const char *path)
{ return winapi::remove_directory(path); }

inline bool get_temporary_path(char *buffer, std::size_t buf_len, std::size_t &required_len)
{
required_len = 0;
Expand Down Expand Up @@ -422,6 +425,9 @@ inline file_handle_t file_handle_from_mapping_handle(mapping_handle_t hnd)
inline bool create_directory(const char *path)
{ return ::mkdir(path, 0777) == 0 && ::chmod(path, 0777) == 0; }

inline bool remove_directory(const char *path)
{ return ::rmdir(path) == 0; }

inline bool get_temporary_path(char *buffer, std::size_t buf_len, std::size_t &required_len)
{
required_len = 5u;
Expand Down
22 changes: 12 additions & 10 deletions include/boost/interprocess/detail/os_thread_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,19 @@
# include <sys/sysctl.h>
# endif
//According to the article "C/C++ tip: How to measure elapsed real time for benchmarking"
# if defined(CLOCK_MONOTONIC_PRECISE) //BSD
//Check MacOs first as macOS 10.12 SDK defines both CLOCK_MONOTONIC and
//CLOCK_MONOTONIC_RAW and no clock_gettime.
# if (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__))
# include <mach/mach_time.h> // mach_absolute_time, mach_timebase_info_data_t
# define BOOST_INTERPROCESS_MATCH_ABSOLUTE_TIME
# elif defined(CLOCK_MONOTONIC_PRECISE) //BSD
# define BOOST_INTERPROCESS_CLOCK_MONOTONIC CLOCK_MONOTONIC_PRECISE
# elif defined(CLOCK_MONOTONIC_RAW) //Linux
# define BOOST_INTERPROCESS_CLOCK_MONOTONIC CLOCK_MONOTONIC_RAW
# elif defined(CLOCK_HIGHRES) //Solaris
# define BOOST_INTERPROCESS_CLOCK_MONOTONIC CLOCK_HIGHRES
# elif defined(CLOCK_MONOTONIC) //POSIX (AIX, BSD, Linux, Solaris)
# define BOOST_INTERPROCESS_CLOCK_MONOTONIC CLOCK_MONOTONIC
# elif !defined(CLOCK_MONOTONIC) && (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__))
# include <mach/mach_time.h> // mach_absolute_time, mach_timebase_info_data_t
# define BOOST_INTERPROCESS_MATCH_ABSOLUTE_TIME
# else
# error "No high resolution steady clock in your system, please provide a patch"
# endif
Expand Down Expand Up @@ -112,17 +114,17 @@ inline bool equal_thread_id(OS_thread_id_t id1, OS_thread_id_t id2)
//return the system tick in ns
inline unsigned long get_system_tick_ns()
{
unsigned long curres;
winapi::set_timer_resolution(10000, 0, &curres);
unsigned long curres, ignore1, ignore2;
winapi::query_timer_resolution(&ignore1, &ignore2, &curres);
//Windows API returns the value in hundreds of ns
return (curres - 1ul)*100ul;
}

//return the system tick in us
inline unsigned long get_system_tick_us()
{
unsigned long curres;
winapi::set_timer_resolution(10000, 0, &curres);
unsigned long curres, ignore1, ignore2;
winapi::query_timer_resolution(&ignore1, &ignore2, &curres);
//Windows API returns the value in hundreds of ns
return (curres - 1ul)/10ul + 1ul;
}
Expand All @@ -132,8 +134,8 @@ typedef unsigned __int64 OS_highres_count_t;
inline unsigned long get_system_tick_in_highres_counts()
{
__int64 freq;
unsigned long curres;
winapi::set_timer_resolution(10000, 0, &curres);
unsigned long curres, ignore1, ignore2;
winapi::query_timer_resolution(&ignore1, &ignore2, &curres);
//Frequency in counts per second
if(!winapi::query_performance_frequency(&freq)){
//Tick resolution in ms
Expand Down
24 changes: 12 additions & 12 deletions include/boost/interprocess/detail/utilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,29 +156,29 @@ BOOST_INTERPROCESS_FORCEINLINE bool size_overflows(SizeType count)
return multiplication_overflows(SizeType(SztSizeOfType), count);
}

template<class RawPointer>
class pointer_uintptr_caster;
template<class RawPointer, class OffsetType>
class pointer_offset_caster;

template<class T>
class pointer_uintptr_caster<T*>
template<class T, class OffsetType>
class pointer_offset_caster<T*, OffsetType>
{
public:
BOOST_INTERPROCESS_FORCEINLINE explicit pointer_uintptr_caster(uintptr_t sz)
: m_uintptr(sz)
BOOST_INTERPROCESS_FORCEINLINE explicit pointer_offset_caster(OffsetType offset)
: m_offset(offset)
{}

BOOST_INTERPROCESS_FORCEINLINE explicit pointer_uintptr_caster(const volatile T *p)
: m_uintptr(reinterpret_cast<uintptr_t>(p))
BOOST_INTERPROCESS_FORCEINLINE explicit pointer_offset_caster(const volatile T *p)
: m_offset(reinterpret_cast<OffsetType>(p))
{}

BOOST_INTERPROCESS_FORCEINLINE uintptr_t uintptr() const
{ return m_uintptr; }
BOOST_INTERPROCESS_FORCEINLINE OffsetType offset() const
{ return m_offset; }

BOOST_INTERPROCESS_FORCEINLINE T* pointer() const
{ return reinterpret_cast<T*>(m_uintptr); }
{ return reinterpret_cast<T*>(m_offset); }

private:
uintptr_t m_uintptr;
OffsetType m_offset;
};


Expand Down
Loading

0 comments on commit 541d428

Please sign in to comment.