Is this supported by JASS, and if so, how is it implemented?
For example, I have several arrays that need to handle large amounts of data (reals), but there is no fixed maximum to the numbers of reals I need to store, so I choose to initialize the array with a large amount of available space and hope it's enouth, but this is a bad approach.
Dynamic Memory Allocation
-
- Keeper of the Keys
- Posts: 434
- Joined: Fri Jan 18, 2008 4:50 pm
- Location: Massachusetts
Dynamic Memory Allocation
Math is # |e^iπ|
"I can't imagine getting hit by a giant rock and not being maimed or crippled or ruined" -Dusk
Logue: Please replace the toilet paper when you use it all. For some reason my 5 year old son believes if it's not there he does not have to wipe.
"I can't imagine getting hit by a giant rock and not being maimed or crippled or ruined" -Dusk
Logue: Please replace the toilet paper when you use it all. For some reason my 5 year old son believes if it's not there he does not have to wipe.
-
- Revenent of the Replies
- Posts: 332
- Joined: Thu Feb 14, 2008 3:27 pm
- Location: Hungary
- Contact:
Re: Dynamic Memory Allocation
From my experiences, the game automatically expands the array when you reference a number not initially within it.
- Fledermaus
- Keeper of the Keys
- Posts: 354
- Joined: Fri Feb 01, 2008 9:55 am
- Location: New Zealand
- Contact:
Re: Dynamic Memory Allocation
In normal jass, the max array size is 8192 but vJass allows big arrays, you have to declare a size though. If you do not know the max size you're going to use, you might want to use a hashtable?