Handle - ?

cr4xzZz

Also known as azwraith_ftL.
Could someone give me the full definition of a handle (in other words - what is a handle)?
And why is leaking handles bad? What does it affect when you get above 8191?
 

Vestras

Retired
A handle is an object - like a unit, a timer, everything.
Units, timers and all that (except booleans, strings, reals and integers) extends the handle type variable, and therefore leaks.
 

cr4xzZz

Also known as azwraith_ftL.
Almost every Warcraft III type is a handle - unit, effect, lightning, location, etc. but that does not include real, integer, string and boolean basically. Handles themselves actually are integers when it comes down to it, and that's what makes handle attachment systems possible (such as Kattana's or Vexorian's CSData). Handle variables do not store values, yet instead the address of one (in other words - they store the reference to an object). Not nulling or not destroying handles results in a handle leak.
Is this definition right? And still:
And why is leaking handles bad? What does it affect when you get above 8191?
 

Vestras

Retired
Yes, except for one thing; handles are not integers, they are handles, that's why people have to use the "H2I" function: (Handle 2 Integer)

JASS:
function H2I takes handle h returns integer
    return h
    return 0
endfunction


(You can basicly do the same thing with everything, like H2S, S2H, because there's a bug, or a blessing, that when returning something, the compiler only compiles the last return, that's why the last return is 0)
 

Flare

Stops copies me!
Staff member
And why is leaking handles bad? What does it affect when you get above 8191?
It can break some attachment systems (since some work on the basis of H2I(h) - FIRST_HANDLE_INDEX and storing the in an array using the result of the subtraction as the array index, and if the result of H2I(h) - FIRST_HANDLE_INDEX is greater than 8191, it'll be too large for a standard array :p)

handles are not integers
I think the common.j says something about that

Anyway, it's possible that they are, if you break them down :p If handles couldn't be 'broken down' to integers, wouldn't the whole concept of H2I not work at all? Wouldn't it result in 0 or something equivalent to null if it had no association with integers?
 

Romek

Super Moderator
Staff member
Having more than 8191 handles really isn't a problem unless you're using attachment systems. Even then, you'll need all of your handles to be using that system at the exact same time.

Anyway, it's possible that they are, if you break them down :p If handles couldn't be 'broken down' to integers, wouldn't the whole concept of H2I not work at all? Wouldn't it result in 0 or something equivalent to null if it had no association with integers?
I'm not too sure about this, so I won't argue about it much.
If you've ever tried changing the file extension of a song or a movie to '.txt' and you opened it (in NotePad), you'd see loads of random symbols and stuff.
Does this mean .mp3 files (just an example) are associated with text files?
Just like Handles would be associated with Integers.

I think it doesn't return 0 because the handle has a value. 0 means... well, nothing.
 

cr4xzZz

Also known as azwraith_ftL.
> Having more than 8191 handles really isn't a problem
Hm, why have I remained with a wrong impression that leaking handles causes lag in-game or crashes (but not from attachment systems) ... Anyway, thanks for pointing out guys.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    It happens in corporations. They just absorb the companies they buy and it is not about the love of making awesome games it is how much money can we make with the least amount of cost.
  • The Helper The Helper:
    Blizzard is watered down now hopefully they can pull it together
  • The Helper The Helper:
    they got a server engineer job opening :)
  • Ghan Ghan:
    I really do not want to move to California otherwise I might consider it.
  • The Helper The Helper:
    yeah California is not anywhere you really want to live
  • The Helper The Helper:
    That is why I did not take the job Blizzard offered me back in the day, there is no way I could have moved my family there on what they were offering, not even close and that was like 20 years ago
  • The Helper The Helper:
    yeah they wanted me on the tech support team when they did not get me they got one of the next MVPs in Dinobot
  • The Helper The Helper:
    Dinobot was one of the youngest of the MVPs tkron probably could have worked for Blizzard but he had a good job in Chicago doing business programming already
  • The Helper The Helper:
    Dinobot probably still works for Blizzard would love to reconnect with that guy
  • The Helper The Helper:
    I wonder what ever happened to Wargasm?
  • The Helper The Helper:
    This new version of Xenforo really is awesome
  • Ghan Ghan:
    Wargasm is still around. He works for the domain registrar where thehelper.net is kept.

    Members online

    No members online now.

    Affiliates

    Hive Workshop
    Top