summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--gc.c7
2 files changed, 18 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f3b5d40fbb..1bbcddc963 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Mon Dec 13 18:13:52 2004 Tanaka Akira <akr@m17n.org>
+
+ * gc.c (stack_end_address): new function to obtain stack end address.
+ stack_end_address calls __builtin_frame_address(0) to obtain the
+ frame pointer of a stack frame of stack_end_address. The address
+ is the stack pointer of the caller's stack frame.
+ (SET_STACK_END): use stack_end_address.
+ This makes the conservative garbage collector to scan a stack frame
+ of the garbage_collect function itself. This is required because
+ callee-save registers may be stored in the frame.
+ [ruby-dev:25158]
+
Mon Dec 13 00:58:02 2004 Tanaka Akira <akr@m17n.org>
* lib/pathname.rb (cleanpath_aggressive): make it private.
diff --git a/gc.c b/gc.c
index b00c170927..62592860d6 100644
--- a/gc.c
+++ b/gc.c
@@ -432,7 +432,12 @@ static unsigned int STACK_LEVEL_MAX = 655300;
# define STACK_END (&stack_end)
#else
# if defined(__GNUC__) && defined(USE_BUILTIN_FRAME_ADDRESS) && !defined(__ia64__)
-# define SET_STACK_END VALUE *stack_end = __builtin_frame_address(0)
+__attribute__ ((noinline)) static VALUE *
+stack_end_address(void)
+{
+ return (VALUE *)__builtin_frame_address(0);
+}
+# define SET_STACK_END VALUE *stack_end = stack_end_address()
# else
# define SET_STACK_END VALUE *stack_end = alloca(1)
# endif