Skip to content

Commit

Permalink
Sync_queue can now optionally use tbb::scalable_allocator.
Browse files Browse the repository at this point in the history
  • Loading branch information
gvansickle committed Jun 26, 2017
1 parent cedcb36 commit 8eee764
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Expand Up @@ -44,7 +44,7 @@ bin_PROGRAMS=ucg
ucg_SOURCES=main.cpp build_info.h libtool
nodist_ucg_SOURCES=build_info.cpp
CLEANFILES += build_info.cpp
ucg_CPPFLAGS = -I $(top_srcdir)/src $(AM_CPPFLAGS) $(PCRE_CPPFLAGS) $(PCRE2_CPPFLAGS)
ucg_CPPFLAGS = -I $(top_srcdir)/src $(AM_CPPFLAGS) $(PCRE_CPPFLAGS) $(PCRE2_CPPFLAGS) $(TBBMALLOC_PROXY_CPPFLAGS) $(TBBMALLOC_CPPFLAGS)
ucg_CFLAGS = $(AM_CFLAGS) $(PCRE_CFLAGS) $(PCRE2_CFLAGS)
ucg_CXXFLAGS = $(AM_CXXFLAGS) $(PCRE_CFLAGS) $(PCRE2_CFLAGS)
ucg_LDFLAGS = $(AM_LDFLAGS)
Expand Down
9 changes: 6 additions & 3 deletions src/sync_queue.h
Expand Up @@ -32,6 +32,10 @@
#include <ext/mt_allocator.h>
#endif

#if HAVE_LIBTBBMALLOC
#include <tbb/scalable_allocator.h>
#endif

enum class queue_op_status
{
success,
Expand All @@ -55,13 +59,12 @@ enum class queue_op_status
template <typename ValueType>
class sync_queue
{
#ifdef TODO
using mt_deque = std::deque<ValueType, std::scoped_allocator_adaptor<__gnu_cxx::__mt_alloc<ValueType>>>;
#if HAVE_LIBTBBMALLOC
using mt_deque = std::deque<ValueType, tbb::scalable_allocator<ValueType>>;
#else
using mt_deque = std::deque<ValueType>;
#endif

//std::queue<ValueType, mt_deque> m_underlying_queue;
mt_deque m_underlying_queue;

public:
Expand Down

0 comments on commit 8eee764

Please sign in to comment.