24# if defined(HAVE_EXECINFO_H)
32#if defined(__x86_64__) || defined(_M_X64)
35#elif defined(__GNUC__) && defined(i386)
44 return (d & 0x04000000) != 0;
45#elif (defined(_MSC_VER) && defined(_M_IX86))
56 return (d & 0x04000000) != 0;
68# if defined(HAVE_EXECINFO_H)
84 nptrs = backtrace(buffer,
SIZE);
85 strings = backtrace_symbols(buffer, nptrs);
86 for (
i = 0;
i < nptrs;
i++) {
87 fputs(strings[
i], fp);
112#if !defined(_WIN32) || defined(FREE_WINDOWS)
119# if defined(__x86_64__)
120 asm(
"cpuid" :
"=a"(
data[0]),
"=b"(
data[1]),
"=c"(
data[2]),
"=d"(
data[3]) :
"a"(selector));
121# elif defined(__i386__)
122 asm(
"pushl %%ebx \n\t"
124 "movl %%ebx, %1 \n\t"
138#if !defined(_M_ARM64)
142 if (
result[0] >=
int(0x80000004)) {
143 __cpuid((
int *)(buf + 0), 0x80000002);
144 __cpuid((
int *)(buf + 16), 0x80000003);
145 __cpuid((
int *)(buf + 32), 0x80000004);
152 DWORD processorNameStringLength = 255;
153 char processorNameString[255];
154 if (RegGetValueA(HKEY_LOCAL_MACHINE,
155 "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0",
156 "ProcessorNameString",
159 &processorNameString,
160 &processorNameStringLength) == ERROR_SUCCESS)
170#if !defined(_M_ARM64)
177 return (
result[2] & (
int(1) << 20)) != 0;
186 if (gethostname(buffer, buffer_maxncpy - 1) < 0) {
190 buffer[buffer_maxncpy - 1] =
'\0';
192 DWORD buffer_size_in_out = buffer_maxncpy;
193 if (!GetComputerName(buffer, &buffer_size_in_out)) {
204 const size_t limit_bytes_half = size_t(1) << (
sizeof(
size_t[8]) - 1);
206 return (limit_bytes_half >> 20) * 2;
213 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 buffer_maxncpy)
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()