lua-users home
lua-l archive

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


On Mon, 10 Sep 2001, John Belmonte wrote:

> Joshua Jensen wrote:
>
> > The nature of Lua's growing of its internal arrays lends itself
> > to fragmentation levels that aren't acceptable in a tight
> > memory environment (such as a game console or embedded
> > device).
>
> In my project I gave up on using Lua in the "main loop" long ago and just
> confined it to init time.  Even so it's much better than life-before-Lua.
>
> Still, I'm interested in seeing how others manage in embedded and hard
> real-time apps.  Have you considered keeping a separate heap for use by Lua?
> This would localize the fragmentation and reduce its effect assuming Lua is
> not allocating large blocks of memory such as for sound or animation data.
> It's the mixing of the large and small blocks that makes fragmentation an
> issue.

I'm Yet Another Game Developer interested in seeing this problem solved.
I've been gradually working my way through the papers at
http://www.cs.utexas.edu/users/oops/papers.html and it seems like, as
noted in http://lua-users.org/wiki/LuaInRealTimePrograms , someone just
needs to crank out an implementation of Wilson's garbage collector.  I did
some work on a couple of home-brew Scheme garbage collectors a few years
back so I'm tempted to jump in, but I fear getting in over my head, or
duplicating a lot of effort.  So, has anybody tried this yet?
Contemplated it seriously?  Have experience with this type of collector in
real-time apps?

-Thatcher Ulrich
http://tulrich.com