1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
/* Generated by Nim Compiler v2.2.0 */
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
typedef struct tyObject_SystemInfo__sGyt4byqm9cRQkCdWf1xiJg tyObject_SystemInfo__sGyt4byqm9cRQkCdWf1xiJg;
struct tyObject_SystemInfo__sGyt4byqm9cRQkCdWf1xiJg {
NU32 u1;
NU32 dwPageSize;
void* lpMinimumApplicationAddress;
void* lpMaximumApplicationAddress;
NU32* dwActiveProcessorMask;
NU32 dwNumberOfProcessors;
NU32 dwProcessorType;
NU32 dwAllocationGranularity;
NU16 wProcessorLevel;
NU16 wProcessorRevision;
};
typedef N_STDCALL_PTR(void, tyProc__LK0pgPO9a9cFvlXrVlE7TGWQ) (tyObject_SystemInfo__sGyt4byqm9cRQkCdWf1xiJg* lpSystemInfo_p0);
static N_INLINE(NI, countProcessorsImpl__pureZconcurrencyZcpuinfo_u6)(void);
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
extern NIM_BOOL nimInErrorMode__system_u4274;
extern tyProc__LK0pgPO9a9cFvlXrVlE7TGWQ Dl_2466250764_;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
void* T1_;
T1_ = (void*)0;
T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (&nimInErrorMode__system_u4274);
return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
}
static N_INLINE(NI, countProcessorsImpl__pureZconcurrencyZcpuinfo_u6)(void) {
NI result;
tyObject_SystemInfo__sGyt4byqm9cRQkCdWf1xiJg si;
nimZeroMem((void*)(&si), sizeof(tyObject_SystemInfo__sGyt4byqm9cRQkCdWf1xiJg));
Dl_2466250764_((&si));
result = ((NI) (si.dwNumberOfProcessors));
{
if (!(result < ((NI)0))) goto LA3_;
result = ((NI)0);
}
LA3_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, ncpicountProcessors)(void) {
NI result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NI)0;
result = countProcessorsImpl__pureZconcurrencyZcpuinfo_u6();
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
|