Fixed bug in taucs_system_memory_size() on Linux 2.6

This commit is contained in:
Laurent Saboret 2006-03-20 11:37:20 +00:00
parent 86adba238c
commit ce976769ea
1 changed files with 12 additions and 11 deletions

View File

@ -67,13 +67,14 @@ double cgal_taucs_available_memory_size()
m = taucs_system_memory_size();
#ifdef OSTYPE_linux
/* taucs_system_memory_size() is buggy on Linux 2.6 */
if (m < 1048576.0)
{
/* It returns only 1% of the actual memory */
#ifdef OSTYPE_linux
m_sys = (double) sysconf(_SC_PAGESIZE);
m_sys *= (double) sysconf(_SC_PHYS_PAGES);
if (m < m_sys/10.0)
{
/* we limit m by 0.75*m_sys */
m = floor(0.75 * m_sys);
}