* gc.c (set_stack_end): new function to obtain stack end address.
set_stack_end obtains a stack end address by an address of local variable in the function. (SET_STACK_END, STACK_END): use set_stack_end. don't use alloca. 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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ad36c25be8
commit
4497af1591
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
Mon Dec 13 18:13:52 2004 Tanaka Akira <akr@m17n.org>
|
||||||
|
|
||||||
|
* gc.c (set_stack_end): new function to obtain stack end address.
|
||||||
|
set_stack_end obtains a stack end address by an address of local
|
||||||
|
variable in the function.
|
||||||
|
(SET_STACK_END, STACK_END): use set_stack_end. don't use alloca.
|
||||||
|
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 02:45:51 2004 Shugo Maeda <shugo@ruby-lang.org>
|
Mon Dec 13 02:45:51 2004 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
* ext/curses/curses.c (window_subwin): call NUM2INT() before
|
* ext/curses/curses.c (window_subwin): call NUM2INT() before
|
||||||
|
21
gc.c
21
gc.c
@ -430,17 +430,18 @@ static unsigned int STACK_LEVEL_MAX = 655300;
|
|||||||
# define STACK_LEVEL_MAX 655300
|
# define STACK_LEVEL_MAX 655300
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef C_ALLOCA
|
#ifdef __GNUC__
|
||||||
# define SET_STACK_END VALUE stack_end; alloca(0);
|
__attribute__ ((noinline))
|
||||||
# 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)
|
|
||||||
# else
|
|
||||||
# define SET_STACK_END VALUE *stack_end = alloca(1)
|
|
||||||
# endif
|
|
||||||
# define STACK_END (stack_end)
|
|
||||||
#endif
|
#endif
|
||||||
|
static void
|
||||||
|
set_stack_end(VALUE **stack_end_p)
|
||||||
|
{
|
||||||
|
VALUE stack_end;
|
||||||
|
*stack_end_p = &stack_end;
|
||||||
|
}
|
||||||
|
#define SET_STACK_END VALUE *stack_end; set_stack_end(&stack_end)
|
||||||
|
#define STACK_END (stack_end)
|
||||||
|
|
||||||
#if defined(sparc) || defined(__sparc__)
|
#if defined(sparc) || defined(__sparc__)
|
||||||
# define STACK_LENGTH (rb_gc_stack_start - STACK_END + 0x80)
|
# define STACK_LENGTH (rb_gc_stack_start - STACK_END + 0x80)
|
||||||
#elif STACK_GROW_DIRECTION < 0
|
#elif STACK_GROW_DIRECTION < 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user