NetBSD-Users archive

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

Re: [Haskell-cafe] Rewrite NetBSD kernel driver using Ajhc Haskell compiler



Hi Johnny,

On Wed, Feb 19, 2014 at 11:57 PM, Johnny Billquist <bqt%update.uu.se@localhost> 
wrote:
> Maybe someone with more insight could explain to an idiot like me how
> Haskell garbage collection is handled when running in the kernel?

First, s_alloc() is Ajhc Haskell compiler's allocator,
and gc_perform_gc() is GC runner.

https://github.com/ajhc/ajhc/blob/6c053b940812689fe22d2dbe2b7ad835dab8a3c7/rts/rts/gc_jgc.c#L560
https://github.com/ajhc/ajhc/blob/6c053b940812689fe22d2dbe2b7ad835dab8a3c7/rts/rts/gc_jgc.c#L119

The s_alloc() try to find free area. But if not, it runs GC.

https://github.com/ajhc/ajhc/blob/6c053b940812689fe22d2dbe2b7ad835dab8a3c7/rts/rts/gc_jgc.c#L435

By the way, where from s_alloc() get a memory chunk?
Now using kern_malloc(9).

https://github.com/metasepi/netbsd-arafura-s1/blob/arafura-s1/metasepi/sys/hsdummy/__dummy4jhc.c#L21

Regards,
-- 
Kiwamu Okabe


Home | Main Index | Thread Index | Old Index