File: %40m..%40slib%40spure%40sconcurrency%40scpuinfo.nim.c

package info (click to toggle)
nim 1.6.10-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,165,312 kB
  • sloc: sh: 20,999; ansic: 1,716; makefile: 958; python: 461; sql: 298; asm: 141; xml: 13
file content (81 lines) | stat: -rw-r--r-- 2,644 bytes parent folder | download
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
79
80
81
/* Generated by Nim Compiler v1.6.10 */
#define NIM_INTBITS 32

#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
#define nimfr_(x, y)
#define nimln_(x, y)
typedef struct tyObject_SYSTEM_INFO__SWgE8AvFHy7UHoDzPkVQvA tyObject_SYSTEM_INFO__SWgE8AvFHy7UHoDzPkVQvA;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
struct tyObject_SYSTEM_INFO__SWgE8AvFHy7UHoDzPkVQvA {
NI32 u1;
NI32 dwPageSize;
void* lpMinimumApplicationAddress;
void* lpMaximumApplicationAddress;
NI32* dwActiveProcessorMask;
NI32 dwNumberOfProcessors;
NI32 dwProcessorType;
NI32 dwAllocationGranularity;
NI16 wProcessorLevel;
NI16 wProcessorRevision;
};
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef N_STDCALL_PTR(void, tyProc__YFpHqv5irNA1pdOWbB74lQ) (tyObject_SYSTEM_INFO__SWgE8AvFHy7UHoDzPkVQvA* lpSystemInfo);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(void*, nimLoadLibrary)(NimStringDesc* path);
N_LIB_PRIVATE N_NIMCALL(void, nimLoadLibraryError)(NimStringDesc* path);
N_LIB_PRIVATE N_NIMCALL(void*, nimGetProcAddr)(void* lib, NCSTRING name);
STRING_LITERAL(TM__h5LhXa1x7tiRXpXshXFkHA_4, "kernel32", 8);
STRING_LITERAL(TM__h5LhXa1x7tiRXpXshXFkHA_5, "kernel32", 8);
static void* TM__h5LhXa1x7tiRXpXshXFkHA_2;
tyProc__YFpHqv5irNA1pdOWbB74lQ Dl_2264924178_;
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
	nimSetMem__systemZmemory_7(p, ((int) 0), size);
}
N_LIB_PRIVATE N_NIMCALL(NI, ncpicountProcessors)(void) {
	NI result;
	tyObject_SYSTEM_INFO__SWgE8AvFHy7UHoDzPkVQvA si;
	result = (NI)0;
	nimZeroMem((void*)(&si), sizeof(tyObject_SYSTEM_INFO__SWgE8AvFHy7UHoDzPkVQvA));
	Dl_2264924178_((&si));
	result = ((NI) (si.dwNumberOfProcessors));
	{
		if (!(result <= ((NI) 0))) goto LA3_;
		result = ((NI) 0);
	}
	LA3_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatslibatspureatsconcurrencyatscpuinfodotnim_DatInit000)(void) {
if (!((TM__h5LhXa1x7tiRXpXshXFkHA_2 = nimLoadLibrary(((NimStringDesc*) &TM__h5LhXa1x7tiRXpXshXFkHA_4)))
)) nimLoadLibraryError(((NimStringDesc*) &TM__h5LhXa1x7tiRXpXshXFkHA_5));
	Dl_2264924178_ = (tyProc__YFpHqv5irNA1pdOWbB74lQ) nimGetProcAddr(TM__h5LhXa1x7tiRXpXshXFkHA_2, "GetSystemInfo");
}