lua-users home
lua-l archive

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

If you mean putting your objects in Lua registry to use Lua's garbage
collector, I don't think it is a good idea. You will get a lots of
overhead on accessing those objects, possible freezes on garbage
collection and so on. Because you application (game) is very sensitive
to performance, I would suggest managing your objects from C++
directly. I do know understand what to you mean by managing memory
using STL (AFAIK STL does not give any memory managing facilities
instead of auto_ptr which is not actually memory manager, but simple
in-scope pointer keeper). But there is a lot of good tools for C++
that helps managing memory. I suggest that you look at Boost library
at "memory" module - there a lots of useful things, like smart
reference-counted pointers, which save a lots of time and head ache.
There is also several garbage collectors for C++, but again, I'm not
sure it is a good idea using them (because of performance).

On 4/13/05, Jose Marin <> wrote:
> Hi!
> I would like to know your oppinion on let Lua manage
> the memory of the game objects (meshes, textures,
> sounds, etc).
> I was using STL, but I think that Lua manages memory
> very well!
> So instead of create a custom objects manager, I'm
> thinking on let Lua do the job!
> What do you think about that?
> Yahoo! Acesso Grátis - Internet rápida e grátis.
> Instale o discador agora!

Best regards,