MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / NumProcs

Function NumProcs

include/vglutil.h:50–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48#endif
49
50static INLINE int NumProcs(void)
51{
52 #ifdef _WIN32
53
54 DWORD_PTR ProcAff, SysAff, i; int count = 0;
55 if(!GetProcessAffinityMask(GetCurrentProcess(), &ProcAff, &SysAff))
56 return 1;
57 for(i = 0; i < sizeof(long *) * 8; i++)
58 if(ProcAff & (1LL << i)) count++;
59 return count;
60
61 #elif defined(__APPLE__)
62
63 return 1;
64
65 #else
66
67 long count = 1;
68 if((count = sysconf(_SC_NPROCESSORS_CONF)) != -1) return (int)count;
69 else return 1;
70
71 #endif
72}
73
74#define BYTESWAP(i) \
75 ( (((i) & 0xff000000) >> 24) | \

Callers 3

runMethod · 0.85
fconfig_reloadenvFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by 1

mainFunction · 0.68