lua-users home
lua-l archive

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


Luiz,

I hadn't a chance to look into 5.1, but 5.0 uses realloc()
in lmem.c.

In case of simple, MMU-less memory banking, allocation
is no big deal, but accessing items is. As only a few
banks (only one in our case) are visible at a time, banks
have to be switched before accessing the data in the bank.

Regards,

Harald

At 07:34 04.06.2004 -0300, you wrote:
>If there are somehow central points, where Lua accesses
>large memory areas, one could implement this.

I'm not sure what you mean, but Lua 5.1 does not rely on malloc. Instead, the
host is required to provide a memory allocator when creating a Lua state. So,
you can implement whatever allocation policy when need or want. But Lua will
still ask for memory as it needs, that is, not in blocks.
--lhf