List:Commits« Previous MessageNext Message »
From:Chris Powers Date:November 28 2007 4:53pm
Subject:Re: bk commit into 6.0 tree (hakank:1.2690)
View as plain text  
Ok to push once "#if defined" is changed to "#ifdef".
After beta: Is sysctl sufficient for systems with > 4GB RAM?

Hakan Kuecuekilmaz wrote:
> Below is the list of changes that have just been committed into a local
> 6.0 repository of hakan. When hakan does a push these changes will
> be propagated to the main repository and, within 24 hours after the
> push, to the public repository.
> For information on how to access the public repository
> see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
> 
> ChangeSet@stripped, 2007-11-28 13:09:37+01:00, hakank@au0012. +1 -0
>   Changed FreeBSD and Mac physical RAM size detection to work with
>   RAM size > 2GB.
> 
>   storage/falcon/Configuration.cpp@stripped, 2007-11-28 13:09:32+01:00, hakank@au0012.
> +13 -3
>     Changed FreeBSD and Mac physical RAM size detection to work with
>     RAM size > 2GB.
> 
> diff -Nrup a/storage/falcon/Configuration.cpp b/storage/falcon/Configuration.cpp
> --- a/storage/falcon/Configuration.cpp	2007-11-27 19:28:06 +01:00
> +++ b/storage/falcon/Configuration.cpp	2007-11-28 13:09:32 +01:00
> @@ -332,12 +332,22 @@ uint64 Configuration::getPhysicalMemory(
>      size_t len = sizeof availableMem;
>      static int mib[2] = {CTL_HW, HW_USERMEM};
>      sysctl(mib, 2, &availableMem, &len, NULL, 0);
> -    
> +
> +    // For physical RAM size on Apple we are using HW_MEMSIZE key,
> +    // because HW_PHYSMEM does not report correct RAM sizes above 2GB.
> +#if defined(__APPLE__)
> +    uint64_t physMem = 0;
> +    mib[1] = HW_MEMSIZE;
> +#endif
> +
> +#if defined(__FreeBSD__)
>      size_t physMem = 0;
> +    mib[1] = HW_PHYSMEM
> +#endif
> +    
>      len = sizeof physMem;
> -    mib[1] = HW_PHYSMEM;
>      sysctl(mib, 2, &physMem, &len, NULL, 0);
> -
> +    
>  	availableMemory = (uint64) availableMem;
>  	totalMemory = (uint64) physMem;
>  	
> 

-- 
Christopher Powers, Senior Software Developer
MySQL Inc, www.mysql.com
Office: +1 612 729 1519

Are you MySQL certified?  www.mysql.com/certification

Thread
bk commit into 6.0 tree (hakank:1.2690)Hakan Kuecuekilmaz28 Nov
  • Re: bk commit into 6.0 tree (hakank:1.2690)Chris Powers28 Nov