• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Leak] Lua Scripting & Memory Leak

Status
Not open for further replies.
Level 3
Joined
Jun 24, 2019
Messages
24
Hello guys,
Since now editor officially support Lua scripting and we all know Lua is a quite common and widely used language, I wonder will it avoid all or part of memory leak problems by using Lua instead of JASS?

Actually the biggest blocker prevent me to create custom games is it forced me always pay much attention to avoid leak and tweak those stuffs which are honestly not part of map features. <= It cause the loss of fun when creating my map.

So I would like to know if switching from JASS to Lua will somehow solve this problem?

If not, could anyone tell me the motivation why Blizzard decide to support Lua??

Thanks in advance!
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,180
Since now editor officially support Lua scripting and we all know Lua is a quite common and widely used language, I wonder will it avoid all or part of memory leak problems by using Lua instead of JASS?
Yes and no.

Lua does not suffer the local declared local agent variable reference counter leak on return bug that JASS does. No need to nil locals before function return with Lua.

Lua currently does not garbage collection Warcraft III object types like location, group and force. These still must be explicitly destroyed. By using adapters and use of __gc metatable entries I have managed to implement a automatic garbage collector for those types but there are potential performance pitfalls for the approach. So that it remains in sync in multiplayer games one must disable the incremental garbage collector and periodically run full garbage collection cycles which could potentially result in stutter. Full mark and sweep cycles can take considerable time to complete for complex virtual machine state graphs.
If not, could anyone tell me the motivation why Blizzard decide to support Lua??
Because it is generally faster, more flexible and not rubbish.
 
Level 3
Joined
Jun 24, 2019
Messages
24
Yes and no.

Lua does not suffer the local declared local agent variable reference counter leak on return bug that JASS does. No need to nil locals before function return with Lua.

Lua currently does not garbage collection Warcraft III object types like location, group and force. These still must be explicitly destroyed. By using adapters and use of __gc metatable entries I have managed to implement a automatic garbage collector for those types but there are potential performance pitfalls for the approach. So that it remains in sync in multiplayer games one must disable the incremental garbage collector and periodically run full garbage collection cycles which could potentially result in stutter. Full mark and sweep cycles can take considerable time to complete for complex virtual machine state graphs.

Because it is generally faster, more flexible and not rubbish.
Okay...Anyway it seems better than JASS lol, thanks for your reply :)
 
Status
Not open for further replies.
Top