Skip to content

Commit

Permalink
Fixed #958: Undefined reference to intrusive_ptr_release (Intel only)
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Oct 17, 2013
1 parent 42bec64 commit a0236c0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
15 changes: 13 additions & 2 deletions hpx/runtime/naming/name.hpp
Expand Up @@ -507,6 +507,15 @@ namespace hpx { namespace naming
HPX_EXPORT void gid_managed_deleter (id_type_impl* p);
HPX_EXPORT void gid_unmanaged_deleter (id_type_impl* p);

#if defined(BOOST_INTEL)
# define HPX_EXPORT_ID_IMPL_HELPERS HPX_EXPORT
#else
# define HPX_EXPORT_ID_IMPL_HELPERS /**/
#endif

HPX_EXPORT_ID_IMPL_HELPERS void intrusive_ptr_add_ref(id_type_impl* p);
HPX_EXPORT_ID_IMPL_HELPERS void intrusive_ptr_release(id_type_impl* p);

///////////////////////////////////////////////////////////////////////
struct HPX_EXPORT id_type_impl : gid_type
{
Expand Down Expand Up @@ -553,13 +562,14 @@ namespace hpx { namespace naming
naming::gid_type prepare_gid() const;

// reference counting
friend void intrusive_ptr_add_ref(id_type_impl* p);
friend void intrusive_ptr_release(id_type_impl* p);
friend HPX_EXPORT_ID_IMPL_HELPERS void intrusive_ptr_add_ref(id_type_impl* p);
friend HPX_EXPORT_ID_IMPL_HELPERS void intrusive_ptr_release(id_type_impl* p);

boost::detail::atomic_count count_;
id_type_management type_;
};

#if !defined(BOOST_INTEL)
/// support functions for boost::intrusive_ptr
inline void intrusive_ptr_add_ref(id_type_impl* p)
{
Expand All @@ -571,6 +581,7 @@ namespace hpx { namespace naming
if (0 == --p->count_)
id_type_impl::get_deleter(p->get_management_type())(p);
}
#endif
}

///////////////////////////////////////////////////////////////////////////
Expand Down
14 changes: 14 additions & 0 deletions src/runtime/naming/name.cpp
Expand Up @@ -263,6 +263,20 @@ namespace hpx { namespace naming

template HPX_EXPORT void id_type_impl::load(
util::portable_binary_iarchive&);

#if defined(BOOST_INTEL)
/// support functions for boost::intrusive_ptr
void intrusive_ptr_add_ref(id_type_impl* p)
{
++p->count_;
}

void intrusive_ptr_release(id_type_impl* p)
{
if (0 == --p->count_)
id_type_impl::get_deleter(p->get_management_type())(p);
}
#endif
} // detail

///////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit a0236c0

Please sign in to comment.