[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Custom memory allocator for running Lua on CM4
- From: KHMan <keinhong@...>
- Date: Wed, 2 Aug 2017 19:43:30 +0800
On 8/2/2017 7:23 PM, RAHUL KUMAR wrote:
Right but problem is that system free is not available /restricted
and even if it is then it will lead to fragmentation. So i was
thinking to manage the memory myself after system malloc. Just
wanted to check if there is already allocator available ?
If you have enough memory/performance, Doug Lea's malloc seems
pretty popular, it's like a de facto standard. Even Cygwin uses
it, only grumblings I recall relating to Cygwin's malloc are some
talk of wishing to maximize performance with some sort of
uClibc has some malloc implementations. There are a number of
other small libc projects in the style of uClibc, all of which
should offer some sort of malloc.
On Wed, Aug 2, 2017 at 4:47 PM, Dhaval Kapil wrote:
> Let me confess i am newbee on Lua and embedded. I am trying to
port Lua on custom freertos running on CM4 and which does not
have reallocation. is there any standard custom memory
I understand that 'realloc' is unavailable on the custom freertos.
If you want a 'hack' to get it running, you could probably
implement the 'realloc' function as a wrapper over 'malloc'
On Wed, Aug 2, 2017 at 4:39 PM, RAHUL KUMAR
<firstname.lastname@example.org <mailto:email@example.com>> wrote:
Let me confess i am newbee on Lua and embedded. I am
trying to port Lua on custom freertos running on CM4 and
which does not have reallocation. is there any standard
custom memory allocator available?
I was thinking to request a bigger chunk of memory in one
shot from the system and later custom allocator will keep
allocating and free memory chunk from that.
Looking forward to hear from you guys.
Kein-Hong Man (esq.)