Re: PowerPC port for company
Posted by
jbsnyder on
URL: http://elua-development.15.s1.nabble.com/PowerPC-port-for-company-tp7578410p7578421.html
Hi -
It's not eLua that adds the requirement for dynamic memory allocation, Lua itself requires and makes extensive use of dynamic memory allocation. Lua runs all the dynamic memory management through realloc (since it can basically perform all the functions of malloc/realloc/free with just realloc). If you only have malloc and free you can work around implementing realloc functionality:
Lua will allocate memory for buffers to store your script in when you compile it, it will have to allocate memory to store the resulting bytecode and it will have to allocate memory for variables/functions/etc.. that are created and assigned as you go along. Even if the variable assignment you do doesn't require a new allocation it's using Lua's stack which is dynamically allocated. You might be doing things in Lua that look like what would be stack allocations in C, but in the Lua VM it's using dynamic memory allocation
You certainly don't need an MMU (most of our targets don't have one). Is there a reason why you might not be able to set aside a heap for Lua and point an existing malloc implementation at it (like the dlmalloc included with eLua)?
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev