[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Question about Lua 5.1.3 and realloc() on life.lua
- From: "Bogdan Marinescu" <bogdan.marinescu@...>
- Date: Fri, 2 May 2008 18:58:33 +0300
> Umm, reinventing the wheel?
Not really. Just giving my statistics module something to chew on :)
It appeared to be easier than trying to understand how to get/compute
fragmentation information from dlmalloc. And it still appears so.
mallinfo() doesn't quite tell me the whole story.
> But if you really, really want to write your own allocator for
> Lua, here are my suggestions: use quick-fit with a relatively
> coarse quantization (*) and tune the fixed bin sizes to the
> observed allocations. Use lazy coalescing for the fixed bin sizes
> and immediate coalescing for the medium sizes. Round up large
> sizes to pages and let the OS manage them. Block splitting should
> look for size 2n+k at least.
Errr. What pages? What OS? :) There aren't any of these strange
animals on my ARM (no MMU, in case you're wondering). As for the fixed
bin sizes, I tried it, and 32 seems to be a value that satisfies most
applications. Not life.lua though :)
Thanks for the tips, I might try them eventually.