[jhc] the new GC, anyone got a bitset?
John Meacham
john at repetae.net
Mon Jun 7 20:00:11 EDT 2010
On Fri, Jun 04, 2010 at 09:51:53PM +0200, Florian Weimer wrote:
> * John Meacham:
>
> > There is just one thing that is bothering me, I still rely on libJudy in
> > the runtime for its extremely fast bitset operation. Basically, in order
> > to determine if an address is allocated on the heap vs on the stack or
> > in the bss or data segments, I use a bitmap, adding an entry for each 4M
> > chunk of memory dedicated to heap pages. on a 64 bit system, using a
> > plain bit array is just not feasable, libJudy has a very fast bitset
> > that I utilize, but it is not exactly lightweight and is LGPL which may
> > cause issues for creating statically linked executables from jhc.
>
> You could use mmap with PROT_NONE to get a large chunk of contiguous
> address space, and allocate the parts you actually use with mprotect,
> setting PROT_READ and PROT_WRITE. Then it's far easier to tell which
> addresses are part of the heap and which aren't.
Yeah, there are various schemes to use mprotect to form write/read
barriers for incremental GCs. For now, I wanted to stick to producing
portable code, however that may be something I explore later. A portable
fallback would still be needed though, so might as well start with that
rather than making assumptions about the target platform.
John
--
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
More information about the jhc
mailing list