View Single Post
02-24-13, 07:25 PM   #8
dhjohn
A Fallenroot Satyr
Join Date: Aug 2012
Posts: 21
Originally Posted by Rythal View Post
update on the memory leak... it's being caused by my attempts to keep memory down, like carbonite of old I was trying to keep colours as a single variable instead of 4.. so like,

WatchList = "red|green|blue"alpha"

but in bringing them back, i'm using strsplit (well actually started with my own custom written explode .. didn't know blizzard had added strsplit) which is causing the memory jumps until garbage collection. Trying to find a better way to do things now instead of calling strsplit constantly.
I'm not sure on lua, but my gut tells me you won't save much space by compacting multiple strings into one. Since a string has to hold each character as a byte, you can't gain space by putting strings together unlike with integers which can hold four bytes in one. (well, you can save the slight overhead of multiple objects, but I can't imagine it is worth the time splitting and joining the strings).