Re: PowerPC port for company

Posted by billson555 on
URL: http://elua-development.15.s1.nabble.com/PowerPC-port-for-company-tp7578410p7578422.html

That might be a possibility. Unfortunately I am still relatively new to our platform; I have only been told by some fellow engineers that our platform/micros aren't meant to implement dynamic memory allocation, but at least one thinks it is a possibility. Nobody has explained to me the finer details of it. Since Lua obviously deals a lot with memory allocation, and at the same time it sounds like we're sticking with this option, we'll probably have to come up with a solution like your suggestion.

Thanks


On Wed, May 21, 2014 at 1:23 PM, James Snyder <[hidden email]> wrote:
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)?


On Tue, May 20, 2014 at 8:32 AM, billson555 <[hidden email]> wrote:
Just to clarify:

We were intending on sending Lua script over some yet un-chosen connection
protocol to run some tests on our hardware. Are you saying that it would be
impossible to run eLua without dynamic memory allocation, even if our Lua
script tests didn't use any dynamic memory allocation?

I just want to be as sure as I can before I have to make any dramatic shifts
in strategy.

Thank you



--
View this message in context: http://elua-development.2368040.n2.nabble.com/PowerPC-port-for-company-tp7578410p7578416.html

Sent from the eLua Development mailing list archive at Nabble.com.
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



--
James Snyder
ph: <a href="tel:%28847%29%20448-0386" value="+18474480386" target="_blank">(847) 448-0386

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



--
Will Johnson
Cell: 1-616-808-1692
Email: [hidden email]

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev