• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Clear Hash or overwrite value ?

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
It depends. If your saving new values to different keys of the hashtable and not using your previously written keys, than you should clear the hash before saving. If you're overwriting keys, than you can just overwrite them and not worry about clearing
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
1) Please do not ask questions in threads other than your own

2) Variable arrays do not allocate space for all 8192 entries if the maximum array size is 1 or not defined

3) They grow dynamically, meaning the space for the key isnt allocated untill it is saved
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
How much memory shall this be, allocating a whole hashtable. Variable arrays are always usable from 0 to 8190/8191 but afaik if you have not used the higher areas yet, it gets mallocated in powers of 2 like

...
using index 16 or higher up to 32-1
using index 32 or higher up to 64-1
using index 64 or higher up to 128-1
...

hardly matters though
 
Status
Not open for further replies.
Top