Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Dec 2005 12:17:20 +0100
From:      Divacky Roman <xdivac02@stud.fit.vutbr.cz>
To:        Sergey Babkin <babkin@verizon.net>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Re: sysctl, HW_PHYSMEM, and crippled gcc
Message-ID:  <20051210111720.GA96448@stud.fit.vutbr.cz>
In-Reply-To: <10939303.1134158545675.JavaMail.root@vms070.mailsrvcs.net>
References:  <10939303.1134158545675.JavaMail.root@vms070.mailsrvcs.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 09, 2005 at 02:02:25PM -0600, Sergey Babkin wrote:
> >From: Divacky Roman <xdivac02@stud.fit.vutbr.cz>
> 
> >On Thu, Dec 08, 2005 at 05:06:16PM -0800, Steve Kargl wrote:
> >> Anyone have any insight into fixing gcc to make better
> >> use of system memory on systems with more than 4 GB.
> >> It appears that libiberty/physmem.c tries to use sysctl()
> >> to determine the amount of physical memory in a system.
> >> 
> >>   { /* This works on *bsd and darwin.  */
> >>     unsigned int physmem;
> >>     size_t len = sizeof physmem;
> >>     static int mib[2] = { CTL_HW, HW_PHYSMEM };
> >> 
> >>     if (sysctl (mib, ARRAY_SIZE (mib), &physmem, &len, NULL, 0) == 0
> >>         && len == sizeof (physmem))
> >>       return (double) physmem;
> >>   }
> >> 
> >> This works if you have less than 4GB because of the unsigned
> >> int physmem.  I have 12 GB, which of course, when expanded
> >> to the number of bytes doesn't fit into a unsigned int physmem.
> 
> >> In particular, ggc-min-heapsize=4096 is ridiculously small for a
> >> system with 12 GB of memory.
> >
> >the code works here (512M of memory)... dont know about the ifdefs its
> >surrounded by..
> 
> I guess you've confused M and G :-) The point is that
> it breaks with over 4G of memory.

dan nelson reported he has the same value with all machine with various ram
sizes. so he presumed the code doesnt work at all... and it did for me



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051210111720.GA96448>