• 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.

will empty array cause leak?

Status
Not open for further replies.
Level 11
Joined
Oct 20, 2007
Messages
342
will empty array cause leak?
example:
U = unit variable
and variable U have array (U[x])
my 1st trigger set U[0]=xxx unit
and 2nd trigger set U[300]= yyy unit

the variable array between 1-299 is empty will this cause leak??

___________________________________________________
want ask me y do that?
coz of doing mui system =.=
 
Level 14
Joined
Nov 23, 2008
Messages
187
No, it won't leak at all. But you should notice, that warcraft dynamically allocates memory for arrays. The size of allocated memory chunks is 256, as far as I know. I.e. when you're setting value to 257th cell of array, new chunk of memory will be allocated. If you want to get slight increase in performance, set the last cell of array (8190) to something, that not equal null - memory will be allocated for all array at once.
 
Status
Not open for further replies.
Top