Qore Programming Language
2.0.0
Loading...
Searching...
No Matches
macros-aarch64.h
1
/* -*- mode: c++; indent-tabs-mode: nil -*- */
2
#ifndef _QORE_MACHINE_MACROS_H
3
4
#define _QORE_MACHINE_MACROS_H
5
6
#define STACK_DIRECTION_DOWN 1
7
8
#if defined(__APPLE__)
9
// empirical testing on macOS 15.2 shows that 80K is sufficient to catch stack exhaustion errors before a crash
10
#define QORE_STACK_GUARD (80 * 1024)
11
#else
12
// tests fail with a stack guard smaller than 34K in Docker instances on ARM Graviton machines
13
// (CI cloud test environment) - tests pass on the same HW not in Docker with a much smaller value
14
#define QORE_STACK_GUARD (34 * 1024)
15
#endif
16
17
#ifdef __GNUC__
18
19
#define HAVE_CHECK_STACK_POS
20
21
static
inline
size_t
get_stack_pos() {
22
size_t
addr;
23
__asm__(
"mov %0, sp"
:
"=r"
(addr) );
24
return
addr;
25
}
26
27
#endif
28
29
#endif