[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Can lua 5.x work with handle-based memory managers...
- From: Rob Kendrick <lua-l@...>
- Date: Thu, 24 Feb 2005 19:05:20 +0000
Joseph Stewart wrote:
Hello my esteemed lua fans!
I use an embedded operating system that looks a lot like the old
(pre-OSX) Apple Macintosh OS. The device has no hardware MMU to
provide a "flat" memory view to software. There are many concurrent
threads competing for the heap, so the OS developers implemented a
"handle-based" memory manager (apps get "pointers-to-pointers"). App
developers are encouraged to "unlock" their memory handles when not
actively using them.
RISC OS has a similar problem. Memory fragmentation is common, and a pain.
The typical solution is to use a "sliding heap" - one that keeps as small as
possible. When you free a block, it shuffles everything down, and updates the
handles (or anchors) to point at the new location.
It's certainly a nice solution to the problem of MMU-less hardware with tiny
amounts of RAM. (Or even MMU-equipt machines, just with a witless OS, in RISC
I'd like to see Lua be able to use such things. I don't actually have any use
for it myself, but I can see why others might find it extremely lovely.