23# if defined(HAVE_EXECINFO_H)
31#if defined(__x86_64__) || defined(_M_X64)
34#elif defined(__GNUC__) && defined(i386)
43 return (d & 0x04000000) != 0;
44#elif (defined(_MSC_VER) && defined(_M_IX86))
55 return (d & 0x04000000) != 0;
67# if defined(HAVE_EXECINFO_H)
83 nptrs = backtrace(buffer,
SIZE);
84 strings = backtrace_symbols(buffer, nptrs);
85 for (
i = 0;
i < nptrs;
i++) {
86 fputs(strings[
i], fp);
109#if !defined(_WIN32) || defined(FREE_WINDOWS)
116# if defined(__x86_64__)
117 asm(
"cpuid" :
"=a"(
data[0]),
"=b"(
data[1]),
"=c"(
data[2]),
"=d"(
data[3]) :
"a"(selector));
118# elif defined(__i386__)
119 asm(
"pushl %%ebx \n\t"
121 "movl %%ebx, %1 \n\t"
135#if !defined(_M_ARM64)
139 if (
result[0] >=
int(0x80000004)) {
140 __cpuid((
int *)(buf + 0), 0x80000002);
141 __cpuid((
int *)(buf + 16), 0x80000003);
142 __cpuid((
int *)(buf + 32), 0x80000004);
149 DWORD processorNameStringLength = 255;
150 char processorNameString[255];
151 if (RegGetValueA(HKEY_LOCAL_MACHINE,
152 "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0",
153 "ProcessorNameString",
156 &processorNameString,
157 &processorNameStringLength) == ERROR_SUCCESS)
167#if !defined(_M_ARM64)
174 return (
result[2] & (
int(1) << 20)) != 0;
183 if (gethostname(buffer, bufsize - 1) < 0) {
187 buffer[bufsize - 1] =
'\0';
189 DWORD bufsize_inout = bufsize;
190 if (!GetComputerName(buffer, &bufsize_inout)) {
201 const size_t limit_bytes_half = size_t(1) << (
sizeof(
size_t[8]) - 1);
203 return (limit_bytes_half >> 20) * 2;
210 return int(
min_zz(limit_megabytes,
size_t(INT_MAX)));
void BLI_kdtree_nd_ free(KDTree *tree)
ATTR_WARN_UNUSED_RESULT const size_t num
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
Compatibility-like things for windows.
BMesh const char void * data
MINLINE size_t min_zz(size_t a, size_t b)
void BLI_system_backtrace_with_os_info(FILE *fp, const void *)
int BLI_system_memory_max_in_megabytes_int()
void BLI_hostname_get(char *buffer, size_t bufsize)
int BLI_cpu_support_sse2()
void BLI_system_backtrace(FILE *fp)
char * BLI_cpu_brand_string()
static void __cpuid(int data[4], int selector)
size_t BLI_system_memory_max_in_megabytes()
int BLI_cpu_support_sse42()