Re: luabind - problem with luabind::object reference
Linker <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
luabind::object obj(luabind::from_stack(ls, -1)); The "obj" hold a ref. On Sun, Dec 20, 2009 at 18:25, Oleksandr . <[email protected]> wrote: > Using C++, lua5.1, luabind 0.7 > > *** Lua code: *** > -- allocates near 8Mb of memory > function fff() > local t = {} > for i = 1, 300000 do > table.insert(t, i) > end > return t > end > > *** C++ code *** > { > luaL_dostring(lua_state, "return fff()"); > luabind::object obj(luabind::from_stack(ls, -1)); > } > lua_gc(l_, LUA_GCCOLLECT, 0); // collect garbage > > Result: Lua still have a 8Mb allocated memory. Garbage collection ignores > that table object. It has references anywhere? But where? That table > deallocates only on program exit (when "lua_close" function called). How to > solve this problem and what is the reason? > > Thank you. > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and > easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > luabind-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/luabind-user > > -- Regards, Linker Lin [email protected] ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ luabind-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/luabind-user