24 # include <execinfo.h>
30 #if defined(__x86_64__) || defined(_M_X64)
33 #elif defined(__GNUC__) && defined(i386)
42 return (d & 0x04000000) != 0;
43 #elif (defined(_MSC_VER) && defined(_M_IX86))
54 return (d & 0x04000000) != 0;
61 #if !defined(_MSC_VER)
66 # if defined(__linux__) || defined(__APPLE__)
76 strings = backtrace_symbols(
buffer, nptrs);
77 for (i = 0; i < nptrs; i++) {
78 fputs(strings[i], fp);
96 #if !defined(_WIN32) || defined(FREE_WINDOWS)
103 # if defined(__x86_64__)
104 asm(
"cpuid" :
"=a"(
data[0]),
"=b"(
data[1]),
"=c"(
data[2]),
"=d"(
data[3]) :
"a"(selector));
105 # elif defined(__i386__)
106 asm(
"pushl %%ebx \n\t"
108 "movl %%ebx, %1 \n\t"
125 if (
result[0] >= (
int)0x80000004) {
126 __cpuid((
int *)(buf + 0), 0x80000002);
127 __cpuid((
int *)(buf + 16), 0x80000003);
128 __cpuid((
int *)(buf + 32), 0x80000004);
144 return (
result[2] & ((
int)1 << 19)) != 0;
152 if (gethostname(
buffer, bufsize - 1) < 0) {
156 buffer[bufsize - 1] =
'\0';
158 DWORD bufsize_inout = bufsize;
159 if (!GetComputerName(
buffer, &bufsize_inout)) {
160 strncpy(
buffer,
"-unknown-", bufsize);
170 const size_t limit_bytes_half = (((size_t)1) << (
sizeof(
size_t[8]) - 1));
172 return (limit_bytes_half >> 20) * 2;
179 return (
int)
min_zz(limit_megabytes, (
size_t)INT_MAX);
void BLI_kdtree_nd_() free(KDTree *tree)
MINLINE size_t min_zz(size_t a, size_t b)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Compatibility-like things for windows.
Read Guarded memory(de)allocation.
SyclQueue void void size_t num_bytes void
ccl_global float * buffer
int BLI_cpu_support_sse41(void)
void BLI_hostname_get(char *buffer, size_t bufsize)
char * BLI_cpu_brand_string(void)
int BLI_cpu_support_sse2(void)
void BLI_system_backtrace(FILE *fp)
static void __cpuid(int data[4], int selector)
size_t BLI_system_memory_max_in_megabytes(void)
int BLI_system_memory_max_in_megabytes_int(void)