Boolexpr questions.

Reaction score
341
Alright, I want to just someone to clarify passing a null [ljass]boolexpr[/ljass] inside events.

I know they leak outside events, but I heard somewhere that they don't for some reason, leak inside events.

Do they :nuts:
 

Frozenhelfir

set Gwypaas = Guhveepaws
Reaction score
56
I've mostly heard no, but the best answer would be testing it with the handle counter.
 

saw792

Is known to say things. That is all.
Reaction score
280
If it does leak, it isn't a handle leak. A handle counter will tell you nothing.

From my experience it doesn't leak.
 

Xorifelse

I'd love to elaborate about discussions...........
Reaction score
87
Boolexpr's are like strings, once they are created they are stored in a table.
Meaning by defining a boolexpr with the same function, it won't leak.

Destroying them has no use at all, parsing a null as value will cause it to leak.

Edit:

If you want to pass a null argument to a boolexpr, create a global boolexpr variable and asign a filter function to it that just returns true.
Then just pass that global variable with the argument.

I can't remember correctly if it leaked on Windows machines, or just would cause a desync on a Mac computer, but either way this method would fix all your issues.
 

Azlier

Old World Ghost
Reaction score
461
I think that one thing was never truly clarified: By GroupEnums, does this include other enumerations (destructables, items)?
 
Reaction score
341
Boolexpr's are like strings, once they are created they are stored in a table.
Meaning by defining a boolexpr with the same function, it won't leak.

Destroying them has no use at all, parsing a null as value will cause it to leak.

I never said anything about destroying them.

If you want to pass a null argument to a boolexpr, create a global boolexpr variable and asign a filter function to it that just returns true.
Then just pass that global variable with the argument.

Yes I know that, I'm asking if they leak in events.

No it doesn't.
It only leaks with GroupEnum...

Some information please :p
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Some information please
I had made a test leak with a null boolexpr inside a TriggerRegister and fast periodic timer like 0.01 s, the memory of the ram didn't grow up.

Unfortunately this post was not on my last 200 ones.
Use search ?

EDIT :


Ok i got it, i suddenly remembered that i had a rep for this, here is the link :
http://www.thehelper.net/forums/showpost.php?p=939924&postcount=7

Rep powaaa, at least it's usefull for something :D
 
Reaction score
341
My memory usage increases with this, is it only because how many events are getting registered to the trigger?

JASS:
library test initializer onInit

    globals
        private trigger t = CreateTrigger()
    endglobals
    
    private function actions takes nothing returns nothing
        call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
        //call DestroyTrigger(t)
        //set t = CreateTrigger()
    endfunction
    
    private function onInit takes nothing returns nothing
        call TimerStart(CreateTimer(), 0.01, true, function actions)
    endfunction
    
endlibrary
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
Possibly, I'm not sure how events behave when you register the same one to a trigger numerous times. Though you have to be careful. ANYTHING can cause temporary increases in memory usage; a great way to demonstrate this is to look at mem usage when absolutely nothing is happening in a map and then pressing the arrow keys and watching the memory shoot up.

In other words, using memory usage to gage things must be done carefully.
 

Romek

Super Moderator
Reaction score
963
TriggerRegister...Event creates a new 'event' handle, so it's no surprise that your memory usage increases with that.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top