lsalzman / iqm

Inter-Quake Model format development kit
MIT License
239 stars 73 forks source link

hashtable resizing for large models #42

Closed graphitemaster closed 4 years ago

graphitemaster commented 4 years ago

The following implements a basic load factor check and resizes the hashtable when the load factor gets too large, which is controllable by MAXLOADFACTOR which is set at 75%. The resizing ratio is controllable by RESIZERATIO and the default of 4 was empirically picked on some large models. If the table gets too large, controlled by MAXSIZE it won't rehash to avoid OOM but rather degrade to linear time operations.