Thread: AutoIndex
View Single Post
Old 04-25-2009, 03:05 PM   #11
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

Quote:
2.) It is possible to break it if handles get too high (rarely a problem in practice)
Not that rare.

It requires a very messed up map, but for some reason those maps are not rare.

Like Griffen said, Make a GetUnit**** function thingy. Guys wanting speed can make it dependent on the UserData implementation (Err, not really, it'll get inlined) but if there was a GetUnit*** function you wouldn't have to make it dependent.

You can make an AutoIndex that uses handle table, Table's only problem was the lack of auto destruction, this effectively fixes it . People that already use UserData in one of those zillion other systems could just use the Table version if they had to implement a system/spell requiring it. The rest, would still see the UserData native inlined anyway. Sounds like win-win to me...

Quote:
Increasing storage space would have no effect on performance except when allocating or freeing an ID.
In order to actually be able to use the index, you would need to also enlarge the arrays to which this is used as index.

Could just have an exceptions list/hash for typeids - assuming this problem is actually important.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote