[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Locking Table Member Additions
- From: Tom N Harris <telliamed@...>
- Date: Tue, 17 Jun 2014 16:48:32 -0400
On Tuesday, June 17, 2014 05:04:29 PM Leinen, Rick wrote:
> The Kinetis microcontroller I am targeting has 1MB of internal flash and
> 256KB of internal SRAM. Neither is a lot, but I have much more flash. By
> defining the table in C, I am hoping that I will be using less RAM since
> the Lua script will be smaller. This may prove out to be negligible, but
> that is the thinking at the time.
The Lua runtime will allocate a table from the same memory pool whether the
definition is made in a script or by C API calls. What you want to do is
create userdata to allow scripts to access the message data in the C
structures. You then have control over where that memory is allocated. You
also save time by not copying data when dispatching the message.