lua-users home
lua-l archive

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


>> It's actually worse than that: anything 
>> that calls malloc or free fails to be real-time (or even soft 
>> real-time) because the C allocator makes no guarantees about 
>> latency.

I am not too sure of your point here. To me memory management refers to the
allocation and deallocation of memory blocks for use by your program,
whereas garbage collection refers to knowing when the blocks are not being
used by the program any more and can be collected. Garbage collection and
memory management are not the same thing. To illustrate, we have replaced
luaM_realloc() with our own memory manager that mallocs pools of lua data
structures on start up and frees the entire pool on program close down. Our
own user data types are also under control of such a memory manager. There
is no mallocing and freeing going on while the program runs. We are also
using a pseudo reference counting system, that collects incrementally so
there is no hit for chained objects. 

This sort of practice is common in much real-time software not just games. I
find it quite sophistical to imply that bugs and latencies in games are due
to the garbage collection systems when your judgement is based only on
superficial phenomenal evidence. As mentioned before, the only real issue
with reference counting systems is circular references. On this last matter
I more that accept your criticisms of the technique.