This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: *bsd & darwin support in libiberty/physmem.c


On Fri, Feb 21, 2003 at 06:11:58PM -0500, Kaveh R. Ghazi wrote:
>  > It applies cleanly against the current gcc trunk's libiberty.  (I
>  > made an update for irix6 earlier today.)
> 
> This one applies cleanly after Rainer's install.  Try it instead,
> thanks.
>
[snip] 
> +	if (sysctl(mib, ARRAY_SIZE(mib), &physmem, &len, NULL, 0) == 0)
> +	  return (double)physmem * pagesize;
> +      }
[snip[
> +	if (sysctl(mib, ARRAY_SIZE(mib), &usermem, &len, NULL, 0) == 0)
> +	  return (double)usermem * pagesize;
> +      }

This causes the test code to produce
total=2082304.000000Mb avail=1836704.000000Mb

The values of physmem and usermem are in bytes, not in pages (at least
on 4.x).


Krzysztof


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]