diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2023-12-11 14:46:50 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2023-12-11 18:56:57 -0500 |
| commit | ba250cc496b2e617823ff8111ef463b6adea27f4 (patch) | |
| tree | dc926851da01b970aca827d6c6ca84b87a7432fa /src/memory-type-defs.hpp | |
| parent | 8047197b62894cb1f7bb6a6871870e4b91fde992 (diff) | |
replace handles with union struct
Diffstat (limited to 'src/memory-type-defs.hpp')
| -rw-r--r-- | src/memory-type-defs.hpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/memory-type-defs.hpp b/src/memory-type-defs.hpp index fea8b36..bc45160 100644 --- a/src/memory-type-defs.hpp +++ b/src/memory-type-defs.hpp @@ -1,6 +1,22 @@ #ifndef PKE_MEMORY_TYPE_DEFS_HPP #define PKE_MEMORY_TYPE_DEFS_HPP +#include <cstdint> + +struct PkeHandle { + union { + struct { + uint32_t bucketIndex; + uint32_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 */ |
