* syscalls.cc (getpagesize): Save pagesize in global variable to

avoid calling GetSystemInfo too often.
        * heap.cc (getpagesize): Eliminate.
        (heap_init): Use getpagesize function from syscalls.cc.
This commit is contained in:
Corinna Vinschen
2001-01-15 12:25:00 +00:00
parent 4cf2c0e0cb
commit dc3651b6cd
3 changed files with 18 additions and 9 deletions

View File

@@ -1353,10 +1353,19 @@ getdtablesize ()
return fdtab.size;
}
static DWORD sys_page_size = 0;
extern "C" size_t
getpagesize ()
{
return sysconf (_SC_PAGESIZE);
if (!sys_page_size)
{
SYSTEM_INFO si;
GetSystemInfo(&si);
sys_page_size = si.dwPageSize;
}
return (int)sys_page_size;
}
/* FIXME: not all values are correct... */