* 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

@@ -46,6 +46,7 @@ struct wincaps
class wincapc
{
SYSTEM_INFO system_info;
OSVERSIONINFOEX version;
char osnam[40];
ULONG wow64;
@@ -54,6 +55,10 @@ class wincapc
public:
void init ();
const DWORD cpu_count () const { return system_info.dwNumberOfProcessors; }
const DWORD page_size () const { return system_info.dwPageSize; }
const DWORD allocation_granularity () const
{ return system_info.dwAllocationGranularity; }
const char *osname () const { return osnam; }
const bool is_wow64 () const { return wow64; }