Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 313e989

Browse files
Modify cuckoo_map iterator
1 parent ac4edc8 commit 313e989

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/common/container/cuckoo_map.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ class StatementCache;
3535
CUCKOO_MAP_TEMPLATE_ARGUMENTS
3636
CUCKOO_MAP_TYPE::CuckooMap() {}
3737

38+
CUCKOO_MAP_TEMPLATE_ARGUMENTS
39+
CUCKOO_MAP_TYPE::CuckooMap(size_t initial_size)
40+
: cuckoo_map(initial_size) {}
41+
3842
CUCKOO_MAP_TEMPLATE_ARGUMENTS
3943
CUCKOO_MAP_TYPE::~CuckooMap() {}
4044

src/include/common/container/cuckoo_map.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,26 @@ namespace peloton {
2424

2525
// CUCKOO_MAP_TEMPLATE_ARGUMENTS
2626
#define CUCKOO_MAP_TEMPLATE_ARGUMENTS template <typename KeyType, \
27-
typename ValueType, typename HashType, typename PredType >
27+
typename ValueType, typename HashType, typename PredType>
2828

2929
// CUCKOO_MAP_DEFAULT_ARGUMENTS
3030
#define CUCKOO_MAP_DEFAULT_ARGUMENTS template <typename KeyType, \
3131
typename ValueType, typename HashType = DefaultHasher<KeyType>, \
3232
typename PredType = std::equal_to<KeyType>>
3333

3434
// CUCKOO_MAP_TYPE
35-
#define CUCKOO_MAP_TYPE CuckooMap<KeyType, ValueType, HashType, PredType >
35+
#define CUCKOO_MAP_TYPE CuckooMap<KeyType, ValueType, HashType, PredType>
3636

3737
// Iterator type
3838
#define CUCKOO_MAP_ITERATOR_TYPE \
39-
typename cuckoohash_map<KeyType, ValueType>::locked_table
39+
typename cuckoohash_map<KeyType, ValueType, HashType, PredType>::locked_table
4040

4141
CUCKOO_MAP_DEFAULT_ARGUMENTS
4242
class CuckooMap {
4343
public:
4444

4545
CuckooMap();
46+
CuckooMap(size_t initial_size);
4647
~CuckooMap();
4748

4849
// Inserts a item
@@ -78,7 +79,8 @@ class CuckooMap {
7879
private:
7980

8081
// cuckoo map
81-
typedef cuckoohash_map<KeyType, ValueType, HashType> cuckoo_map_t;
82+
typedef cuckoohash_map<KeyType, ValueType, HashType, PredType>
83+
cuckoo_map_t;
8284

8385
cuckoo_map_t cuckoo_map;
8486
};

0 commit comments

Comments
 (0)