summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index a7e272f..2b50ffa 100644
--- a/gc.c
+++ b/gc.c
@@ -905,7 +905,11 @@ rb_gc()
alloca(0);
# define STACK_END (&stack_end)
#else
+# if defined(__GNUC__)
+ VALUE *stack_end = __builtin_frame_address(0);
+# else
VALUE *stack_end = alloca(1);
+# endif
# define STACK_END (stack_end)
#endif
@@ -978,9 +982,11 @@ void
Init_stack(addr)
VALUE *addr;
{
-#ifdef __human68k__
+#if defined(__human68k__)
extern void *_SEND;
rb_gc_stack_start = _SEND;
+#elsif defined(__GNUC__)
+ rb_gc_stack_start = __builtin_frame_address(2);
#else
VALUE start;