[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Custom memory allocator for running Lua on CM4
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 2 Aug 2017 08:51:01 -0300
> 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.
Try the K&R allocator. Google found a copy at
https://github.com/BoiseState/CS453-resources/tree/master/examples/memory-management/simple-malloc
If you want to find other copies, search for
"morecore: ask system for more memory"
You'll have to adapt morecore to your needs: for instance, by replacing sbrk.