code gen can generate code to keep alive stack roots
This commit is contained in:
parent
f19c1c0f6e
commit
cd83cc81aa
12 changed files with 125 additions and 44 deletions
|
|
@ -16,6 +16,7 @@ __GNUC__
|
|||
__DMC__
|
||||
__POCC__
|
||||
__TINYC__
|
||||
__clang__
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -437,4 +438,11 @@ __declspec(naked) int __fastcall NimXadd(volatile int* pNum, int val) {
|
|||
# define unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
static inline void GCGuard (void *ptr) { asm volatile ("" :: "X" (ptr)); }
|
||||
# define GC_GUARD __attribute__ ((cleanup(GCGuard)))
|
||||
#else
|
||||
# define GC_GUARD
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue