Added comment about RT hash. Fixed memory leak in NavmeshList main.

This commit is contained in:
2022-09-06 17:08:57 +10:00
parent f78bcbf8f8
commit 03da61a716
2 changed files with 12 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
/* For reading structured data out of Creation Engine esp/esm files.
* Based on information from:
* https://en.uesp.net/wiki/Skyrim_Mod:Mod_File_Format
* https://github.com/TES5Edit/TES5Edit
*
* esp/esm files generally have a tree-like structure where:
* - top level is a a TES4 record concatenated with each of the top-level groups
@@ -29,6 +30,13 @@ extern "C" {
#define RT_SIZE 128
/* RT hash seed was externally calculated s.t. the fourcc codes perfectly hash into
* indices between 0 and 511. That is, there are no hashing collisions. This allows
* for hard coded lookup tables for the fourcc codes in a relatively small space.
*
* A minimal perfect hash is also possible with an intermediate seed table, though
* I'm not sure which is faster, if it's worth trying to speed this up, etc.
*/
#define RT_HASH_SIZE 512
#define RT_HASH_BITS 9
#define RT_HASH_SEED 131261257