From 1295fdea6f1674fc12de16ede3e9caad12e78012 Mon Sep 17 00:00:00 2001 From: ryan-rsm-mckenzie Date: Mon, 10 Jul 2023 10:47:26 -0700 Subject: [PATCH] scatter table findings --- .../include/RE/Bethesda/BSTSmallIndexScatterTable.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CommonLibF4/include/RE/Bethesda/BSTSmallIndexScatterTable.h b/CommonLibF4/include/RE/Bethesda/BSTSmallIndexScatterTable.h index 03b4513a..53232ad3 100644 --- a/CommonLibF4/include/RE/Bethesda/BSTSmallIndexScatterTable.h +++ b/CommonLibF4/include/RE/Bethesda/BSTSmallIndexScatterTable.h @@ -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 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