* fhandler_proc.cc (format_proc_uptime): Don't call GetSystemInfo.

Fetch CPU count from wincap.
	(format_proc_stat): Ditto.
	* globals.cc (system_info): Move to wincap.
	* heap.cc (heap_init): Fetch page size from wincap.
	* syscalls.cc (getpagesize): Fetch allocation granularity from wincap.
	(getsystempagesize): Fetch page size from wincap.
	* wincap.cc (wincap_2003): Default is_server to false.
	(wincapc::init): Call GetSystemInfo here.  Always set is_server value.
	* wincap.h (class wincapc): Add system_info as private member.
	(wincapc::cpu_count): New public method.
	(wincapc::page_size): Ditto.
	(wincapc::allocation_granularity): Ditto.
This commit is contained in:
Corinna Vinschen
2011-05-10 15:39:02 +00:00
parent 6cfbf1a573
commit c29e693388
7 changed files with 34 additions and 24 deletions

View File

@@ -2287,17 +2287,13 @@ getdtablesize ()
extern "C" int
getpagesize ()
{
if (!system_info.dwAllocationGranularity)
GetSystemInfo (&system_info);
return (size_t) system_info.dwAllocationGranularity;
return (size_t) wincap.allocation_granularity ();
}
size_t
getsystempagesize ()
{
if (!system_info.dwPageSize)
GetSystemInfo (&system_info);
return (size_t) system_info.dwPageSize;
return (size_t) wincap.page_size ();
}
/* FIXME: not all values are correct... */