diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-06-16 07:01:32 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-06-16 07:01:32 +0000 |
commit | 35ec0ad3f34424267a9193a472f093a648b451a3 (patch) | |
tree | 086655da35e1b9c382f017088914436d54158136 | |
parent | 8335f4254342066c5a428542eb16f7a9794c24ec (diff) |
* 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/branches/ruby_1_8@6461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | gc.c | 11 |
2 files changed, 17 insertions, 8 deletions
@@ -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> * ext/tk/lib/tk.rb: bug fix (TkWindow#grab) @@ -50,14 +56,14 @@ Thu Jun 10 19:19:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org> [ruby-talk:103062] Wed Jun 9 18:04:14 2004 akira yamada <akira@ruby-lang.org> - + * lib/uri/generic.rb (URI::Generic::merge, URI::Generic::route_from): accepts non-hierarchical URI. [ruby-dev:23631] - + * test/uri/test_generic.rb (TestGeneric::test_route, TestGeneric::test_merge): added tests for above changes. - + Wed Jun 9 17:39:37 2004 Akinori MUSHA <knu@iDaemons.org> * config.guess, config.sub: Update to a more recent version as of @@ -146,7 +152,7 @@ Thu May 27 23:15:18 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp> Thu May 27 21:37:50 2004 Tanaka Akira <akr@m17n.org> - * lib/pathname.rb (Pathname#initialize): refine pathname initialization + * lib/pathname.rb (Pathname#initialize): refine pathname initialization by pathname. Thu May 27 20:22:05 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> @@ -447,15 +447,17 @@ static unsigned int STACK_LEVEL_MAX = 655300; #elif STACK_GROW_DIRECTION < 0 # define STACK_UPPER(x, a, b) b #else +static int grow_direction; static int -stack_growup_p(addr) +stack_grow_direction(addr) VALUE *addr; { SET_STACK_END; - if (STACK_END > addr) return Qtrue; - return Qfalse; + if (STACK_END > addr) return grow_direction = 1; + 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) #endif @@ -1411,10 +1413,11 @@ Init_stack(addr) rb_gc_stack_start = _SEND; #else if (!addr) addr = (VALUE *)&addr; + STACK_UPPER(&addr, addr, ++addr); if (rb_gc_stack_start) { if (STACK_UPPER(&addr, rb_gc_stack_start > addr, - rb_gc_stack_start < ++addr)) + rb_gc_stack_start < addr)) rb_gc_stack_start = addr; return; } |