summaryrefslogtreecommitdiff
path: root/src/memory-type-defs.hpp
blob: d9d6f5e9eb5fb7c9e3724275a91ac79bd486b876 (plain)
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
#ifndef PKE_MEMORY_TYPE_DEFS_HPP
#define PKE_MEMORY_TYPE_DEFS_HPP

#include <cstdint>

using PkeHandleBucketIndex_T = uint32_t;
using PkeHandleItemIndex_T = uint32_t;

struct PkeHandle {
	union {
		struct {
			PkeHandleBucketIndex_T bucketIndex;
			PkeHandleItemIndex_T itemIndex;
		};
		uint64_t hash = 0xFFFFFFFFFFFFFFFF;
	};
};

constexpr bool operator==(const PkeHandle &a, const PkeHandle &b) {
	return a.hash == b.hash;
}

struct MemBucket;

#endif /* PKE_MEMORY_TYPE_DEFS_HPP */