switch the IndexType and Allocator in AtomicUnorderedInsertMap template
authorZhen (Growth) Li <lizhen@fb.com>
Wed, 4 Nov 2015 01:31:55 +0000 (17:31 -0800)
committerfacebook-github-bot-9 <folly-bot@fb.com>
Wed, 4 Nov 2015 02:20:28 +0000 (18:20 -0800)
Summary: Our use case need to have the IndexType Configurable, but in this diff D2583752, lint error shows
  Code from folly::detail is logically private, please avoid use outside of folly.
In order to fix this lint error, I switch the IndexType and Allocator in the AtomicUnorderedInsertMap template.

Reviewed By: nbronson

Differential Revision: D2610921

fb-gh-sync-id: ae81b41e7c8c971f26c61b8c67dabeadff379584

folly/AtomicUnorderedMap.h
folly/test/AtomicUnorderedMapTest.cpp

index 4c0afb689aa30426aec8bf4f6d4b990ab8d27a28..9f139de0b1c07adf8d4b0570748b0510e8991420 100644 (file)
@@ -135,8 +135,8 @@ template <typename Key,
               (boost::has_trivial_destructor<Key>::value &&
                boost::has_trivial_destructor<Value>::value),
           template<typename> class Atom = std::atomic,
-          typename Allocator = folly::detail::MMapAlloc,
-          typename IndexType = uint32_t>
+          typename IndexType = uint32_t,
+          typename Allocator = folly::detail::MMapAlloc>
 
 struct AtomicUnorderedInsertMap {
 
@@ -493,9 +493,8 @@ using AtomicUnorderedInsertMap64 =
                              KeyEqual,
                              SkipKeyValueDeletion,
                              Atom,
-                             Allocator,
-                             uint64_t>;
-
+                             uint64_t,
+                             Allocator>;
 
 /// MutableAtom is a tiny wrapper than gives you the option of atomically
 /// updating values inserted into an AtomicUnorderedInsertMap<K,
index 46a97b53b993ecef08b7bf5e77fd056f51326b20..b830a3886235abf0c8522f4dce4e7522eb76b813 100644 (file)
@@ -94,8 +94,8 @@ using UIM =
                              (boost::has_trivial_destructor<Key>::value &&
                               boost::has_trivial_destructor<Value>::value),
                              Atom,
-                             Allocator,
-                             IndexType>;
+                             IndexType,
+                             Allocator>;
 
 namespace {
 template <typename T>