зеркало из https://github.com/github/ruby.git
* gc.c (stack_grow_direction): memoize the direction.
* gc.c (Init_stack): should always move to end of VALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
f895f94cce
Коммит
83c917df38
|
@ -1,3 +1,9 @@
|
||||||
|
Wed Jun 16 16:01:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* gc.c (stack_grow_direction): memoize the direction.
|
||||||
|
|
||||||
|
* gc.c (Init_stack): should always move to end of VALUE.
|
||||||
|
|
||||||
Tue Jun 15 12:10:04 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
Tue Jun 15 12:10:04 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
||||||
* ext/tk/lib/tk.rb: bug fix (TkWindow#grab)
|
* ext/tk/lib/tk.rb: bug fix (TkWindow#grab)
|
||||||
|
@ -59,7 +65,7 @@ Wed Jun 9 16:09:01 2004 akira yamada <akira@ruby-lang.org>
|
||||||
* lib/uri/generic.rb (URI::Generic::merge,
|
* lib/uri/generic.rb (URI::Generic::merge,
|
||||||
URI::Generic::route_from): accepts non-hierarchical URI.
|
URI::Generic::route_from): accepts non-hierarchical URI.
|
||||||
[ruby-dev:23631]
|
[ruby-dev:23631]
|
||||||
|
|
||||||
* test/uri/test_generic.rb (TestGeneric::test_route,
|
* test/uri/test_generic.rb (TestGeneric::test_route,
|
||||||
TestGeneric::test_merge): added tests for above changes.
|
TestGeneric::test_merge): added tests for above changes.
|
||||||
|
|
||||||
|
|
11
gc.c
11
gc.c
|
@ -447,15 +447,17 @@ static unsigned int STACK_LEVEL_MAX = 655300;
|
||||||
#elif STACK_GROW_DIRECTION < 0
|
#elif STACK_GROW_DIRECTION < 0
|
||||||
# define STACK_UPPER(x, a, b) b
|
# define STACK_UPPER(x, a, b) b
|
||||||
#else
|
#else
|
||||||
|
static int grow_direction;
|
||||||
static int
|
static int
|
||||||
stack_growup_p(addr)
|
stack_grow_direction(addr)
|
||||||
VALUE *addr;
|
VALUE *addr;
|
||||||
{
|
{
|
||||||
SET_STACK_END;
|
SET_STACK_END;
|
||||||
|
|
||||||
if (STACK_END > addr) return Qtrue;
|
if (STACK_END > addr) return grow_direction = 1;
|
||||||
return Qfalse;
|
return grow_direction = -1;
|
||||||
}
|
}
|
||||||
|
# define stack_growup_p(x) ((grow_direction ? grow_direction : stack_grow_direction(x)) > 0)
|
||||||
# define STACK_UPPER(x, a, b) (stack_growup_p(x) ? a : b)
|
# define STACK_UPPER(x, a, b) (stack_growup_p(x) ? a : b)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1410,10 +1412,11 @@ Init_stack(addr)
|
||||||
rb_gc_stack_start = _SEND;
|
rb_gc_stack_start = _SEND;
|
||||||
#else
|
#else
|
||||||
if (!addr) addr = (VALUE *)&addr;
|
if (!addr) addr = (VALUE *)&addr;
|
||||||
|
STACK_UPPER(&addr, addr, ++addr);
|
||||||
if (rb_gc_stack_start) {
|
if (rb_gc_stack_start) {
|
||||||
if (STACK_UPPER(&addr,
|
if (STACK_UPPER(&addr,
|
||||||
rb_gc_stack_start > addr,
|
rb_gc_stack_start > addr,
|
||||||
rb_gc_stack_start < ++addr))
|
rb_gc_stack_start < addr))
|
||||||
rb_gc_stack_start = addr;
|
rb_gc_stack_start = addr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче