On Sun, May 07, 2006 at 10:26:20PM +0200, Laurynas Biveinis wrote:
> - Cygwin's mmap() is still buggy. There was a lot of work on it
> previously, the last message I could find on the subject was
> http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00521.html . It
> suggested, that Cygwin's mmap() maybe could be un-blacklisted now.
> Well, it cannot. Zone collector unearths the problem that
> munmap(address, some_amount) actually unmaps 64KB when some_amount is
> e.g. 20KB. I've tested both MMAP_ANON and /dev/zero. If anybody is
> interested, I can provide the testcases. If nobody is, then maybe
> someday I'll find time to make testcases directly against Cygwin libc.
> 
> For GCC it means that any mmap'y collector, if it's to become a single
> GCC collector, will need additional work here. It is possible to
> implement a workaround (free only 64KB worth of adjacent free pages)
> at cost of some memory expense, or use valloc(), or the malloc() code
> from ggc-page. Of course, only the first option is viable for copying
> collector. I wonder if cygwin's mprotect() has a set of similar
> issues.

Or just use 64K pages on Cygwin.  It sounds like that's what's going
on.  We may be fetching the page size incorrectly from the system.
In fact, see how bogus the code currently in ggc-zone.c is for the page
size?

I suspect Cygwin is blameless here.  The runtime page size detection
would probably work better (but it's slower).

> - In other news, I've linked Boehm's GC with GGC, provided
> implementations for ggc_alloc_stat(), ggc_collect(), and stubbed out
> everything else. The result works only with disabled collection (i.e.
> Boehm's GC allocation routines and nothing else is used). Otherwise it
> collects identifier symbol table almost immediatelly after its
> creation. A little bit of debugging suggests that there is an issue of
> Boehm's GC being not aware of all roots. This can be solved either
> moving data structures living partly in malloc() memory, partly in GC
> memory to one of them or by registering additional roots with GC.

Presumably you'd have to register all the GTY()'d roots... I don't know
how that would work out.

-- 
Daniel Jacobowitz
CodeSourcery

Reply via email to