Skip to content

Commit

Permalink
scatter table findings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan-rsm-McKenzie committed Jul 10, 2023
1 parent dcae019 commit 1295fde
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CommonLibF4/include/RE/Bethesda/BSTSmallIndexScatterTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@ namespace RE
// maps a key to a uint32_t index
// the value of the index is provided externally (typically just some counter)
// this index is used to index an array, which is also provided externally
// essentially implements a scatter table with chaining for conflict resolution
// it is honestly impressive how awful this data structure is, bethesda never fails to impress
template <class T, class Accessor>
class BSTSmallIndexScatterTable
{
public:
struct entry_type
{
std::uint16_t next = 0xFFFF; // the next slot the check for conflict resolution, or 0xFFFF if no chain
std::uint16_t index = 0xFFFF; // the actual index, or 0xFFFF if invalid
};

std::uint64_t pad; // 00
std::uint32_t* table; // 08
entry_type* table; // 08
std::uint32_t size; // 10
std::uint32_t mask; // 14
std::uint32_t avail; // 18
Expand Down

0 comments on commit 1295fde

Please sign in to comment.