-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontainer_impl.h
More file actions
30 lines (23 loc) · 782 Bytes
/
Copy pathcontainer_impl.h
File metadata and controls
30 lines (23 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef VI_CONTAINER_IMPL_H
#define VI_CONTAINER_IMPL_H
#include "common_defs.h"
#include "atomic_hashset.hpp"
#include "atomic_queue.hpp"
#include "data_structs.hpp"
#define HIMPL_MAX_ELEMENT_COUNT ((1024 * 1024 * 100) / sizeof(vi::Message))
#define HIMPL_PAGE_SIZE (HIMPL_MAX_ELEMENT_COUNT / 1000)
#define QIMPL_BUFFER_SIZE (1024 * 10)
namespace vi
{
template<uint32_t MaxEntries>
struct uint64_hash
{
static uint32_t to_index(const uint64_t& key)
{
return (uint32_t)(key % MaxEntries);
}
};
typedef atomic_hashset<uint64_t, Message, uint64_hash<HIMPL_MAX_ELEMENT_COUNT>, HIMPL_MAX_ELEMENT_COUNT, HIMPL_PAGE_SIZE> container_hashset;
typedef atomic_queue<uint64_t, QIMPL_BUFFER_SIZE> container_queue;
};
#endif