lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Thanks Luiz and Kein. I will try and keep you guys posted.

On Wed, Aug 2, 2017 at 5:21 PM, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> 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.