PATCH: new GC implementation

Zack Weinberg zack@bitmover.com
Thu Sep 30 23:58:00 GMT 1999


Jeffrey A Law wrote:
>   In message < m34sgnqpyz.fsf@fred.muc.de >you write:
>   > samuel@codesourcery.com (Alex Samuel) writes:
>   > > 
>   > > Finally, the allocator obtains memory by mmap'ing from /dev/zero.
>   > > However, the fact that the memory is zeroed out is not used.  On
>   > > Linux, the non-standard `anonymous' mmap is used, which hands back the
>   > > memory as-is without zeroing it.  Those familiar with other host
>   > > systems may know of similar optimizations.
>   > 
>   > Erm. Of course Linux zeroes all pages it hands to user processes. Otherwi
> se
>   > that would be a gapping security hole. So mapping /dev/zero and anonymous
>   > mappings should be equivalent, both will zero lazily. You can probably
>   > remove the special case for Linux.
> Hopefully the implementation does not special case linux in this way and
> instead uses an autoconf test to look for the feature it needs.

No autoconf test is needed.  Just change all #ifndef __linux__ to
#ifndef MAP_ANONYMOUS.

zw



More information about the Gcc-patches mailing list