lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi guys,

I've got a question, when I run this code:

char *t="function foo()\n a=1 \n end\n";

for (int i=0; i < 10000; i++)
  lua_dostring(L, t);


The memory usage of Lua increases dramatically, it seems as though Lua
stores the function "foo" 10.000 times instead of replacing the
previous function. Is this correct ? Is it possible (for me) to
change this behaviour, if so where should i start looking in the
source.

I'm asking this because a program that I'm the author of ( girder ),
is about to switch to Lua as the scripting language, but it turned up
that running the same script (with a function) over and over
again will fill up the memory quickly.

Thanks!

Ron