lua-users home
lua-l archive

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


> Of course, I
> have little experience with the Mac and so I
> don't know exactly how malloc()/free()/realloc()
> works there....

The Mac supports both movable and fixed memory. FIxed memory is accessed
through a regular pointer, and will never move. Movable memory is
accessed through a "handle" (which is a pointer to a pointer). The Macs
Memory Manager can therefore do heap compactions of such moveable blocks
simply by updating the second pointer (ie, the one pointed to by the
handle). This avoids heap fragmentation, but increases program
complexity as well as the risk for "interesting" bugs.

Mike Fahl
----------------
Dataton - TRUE MULTIMEDIA integration and show control systems.
Check it out at http://www.dataton.com