mirror of https://github.com/CGAL/cgal
Fixed bug in taucs_system_memory_size() on Linux 2.6
This commit is contained in:
parent
86adba238c
commit
ce976769ea
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue