lua-users home
lua-l archive

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


Hallo,

On Tue, Jul 12, 2011 at 1:30 PM, Tony Finch <dot@dotat.at> wrote:
>
> It requires a heap allocation for all function calls and it destroys
> the locality benefits you get from stack allocation. Freeing a stack
> frame requires a gc rather than a pointer adjustment. To minimize the
> overheads you need a bump allocator (so that heap allocation is as
> efficient as stack allocation), you need to keep tight control of
> pointers into the nursery (to make GC quick), and you need to make the
> nursery a decent size (to amortize the cost of GC) but not so large that
> it blows the CPU cache.
>

     The already cited Chicken Scheme compiler allocates *everything*,
not just function call frames, on the stack, until a minor GC is
requested, which makes the C stack effectively work as the first
generation of a generational garbage collection and makes allocation
be *very* fast.

-- 
-alex
http://www.artisancoder.com/