The lines

+# else
+#  error "don't know how to get the amount of physical memory for your OS"
+# endif

will break on Windows.

Thanks,
Ren Zou

Fabian wrote:
> Update of /cvsroot/monetdb/MonetDB/src/gdk
> In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17611
>
> Modified Files:
>       gdk_system.mx 
> Log Message:
> If there is a limit get on the memory usage, take it into account, such that 
> the GDK kernel can make the proper decisions.  Indented ifdefs to make 
> nesting structure clear.  Added comment on probably obsolete piece of code.
>
> Index: gdk_system.mx
> ===================================================================
> RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk_system.mx,v
> retrieving revision 1.120
> retrieving revision 1.121
> diff -u -d -r1.120 -r1.121
> --- gdk_system.mx     4 Nov 2009 16:49:24 -0000       1.120
> +++ gdk_system.mx     15 Dec 2009 12:38:37 -0000      1.121
> @@ -339,9 +339,9 @@
>               _MT_pagesize = sysInfo.dwPageSize;
>       }
>  #else
> -#if defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE)
> +# if defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE)
>       _MT_pagesize = sysconf(_SC_PAGESIZE);
> -#endif
> +# endif
>  #endif
>       if (_MT_pagesize <= 0)
>               _MT_pagesize = 4096;    /* default */
> @@ -366,14 +366,40 @@
>  #if defined(HAVE_SYSCONF) && defined(_SC_PHYS_PAGES)
>       _MT_npages = sysconf(_SC_PHYS_PAGES);
>  #else
> -#ifdef HAVE_GETRLIMIT
> +# if defined(HAVE_GETRLIMIT) && defined(RLIMIT_RSS)
>       {
>               struct rlimit rl;
>  
> +             /* Specifies the limit (in pages) of the process's resident set
> +              * (the number of virtual pages resident in RAM). This limit
> +              * only has effect in Linux 2.4.x, x < 30, and there only
> +              * affects calls to madvise() specifying MADV_WILLNEED */
> +             /* FIXME: this looks like a total wrong thing to check in any
> +              * case to me */
>               getrlimit(RLIMIT_RSS, &rl);
>               _MT_npages = rl.rlim_cur / _MT_pagesize;
>       }
> +# else
> +#  error "don't know how to get the amount of physical memory for your OS"
> +# endif
>  #endif
> +#ifdef HAVE_GETRLIMIT
> +     {
> +             struct rlimit rl;
> +             size_t memlim;
> +
> +             /* The environment can be limited memory wise.  In such case the
> +              * physically available memory, is not necessarily what we can
> +              * also use. */
> +             getrlimit(RLIMIT_DATA, &rl);
> +             if (rl.rlim_cur != (rlim_t)RLIM_INFINITY) {
> +                     /* rlimit returns in bytes, recalculate */
> +                     memlim = rl.rlim_cur / _MT_pagesize;
> +                     /* if it's more restrictive, take that as value */
> +                     if (memlim < _MT_npages)
> +                             _MT_npages = memlim;
> +             }
> +     }
>  #endif
>  }
>  
>
>
> ------------------------------------------------------------------------------
> Return on Information:
> Google Enterprise Search pays you back
> Get the facts.
> http://p.sf.net/sfu/google-dev2dev
> _______________________________________________
> Monetdb-checkins mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/monetdb-checkins
>
>   


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Monetdb-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-developers

Reply via email to