diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-08 10:27:23 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-08 10:27:23 +0000 |
commit | aa4878589c57acdee9f189b67f1dc55c1283fa16 (patch) | |
tree | 2d1db19a07b7ea335ee87d1695c1e6b8fd952bb4 | |
parent | 4e7110d4355e9236467a1f63cfe4b625394b3043 (diff) | |
download | ruby-aa4878589c57acdee9f189b67f1dc55c1283fa16.tar.gz |
* configure.in (rb_cv_stack_end_address): detect stack end address
variable supplied by system. [ruby-core:03115]
* gc.c (Init_stack): use system provided address if possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | configure.in | 12 | ||||
-rw-r--r-- | gc.c | 17 |
3 files changed, 34 insertions, 4 deletions
@@ -1,3 +1,10 @@ +Thu Jul 8 19:27:16 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * configure.in (rb_cv_stack_end_address): detect stack end address + variable supplied by system. [ruby-core:03115] + + * gc.c (Init_stack): use system provided address if possible. + Thu Jul 8 00:05:23 2004 akira yamada <akira@ruby-lang.org> * lib/tempfile.rb (Tempfile::initialize): got out code of @@ -19,7 +26,7 @@ Wed Jul 7 00:48:34 2004 WATANABE Hirofumi <eban@ruby-lang.org> Tue Jul 6 18:38:45 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> - * ext/tk/lib : improve framework of developping Tcl/Tk extension + * ext/tk/lib : improve framework of developping Tcl/Tk extension wrappers Mon Jul 5 23:56:42 2004 Kouhei Sutou <kou@cozmixng.org> diff --git a/configure.in b/configure.in index 0a4e2fd830..79dde00a87 100644 --- a/configure.in +++ b/configure.in @@ -389,6 +389,18 @@ AC_STRUCT_ST_BLKSIZE AC_STRUCT_ST_BLOCKS AC_STRUCT_ST_RDEV +AC_CACHE_CHECK(for stack end address, rb_cv_stack_end_address, +[rb_cv_stack_end_address=no +for addr in __libc_stack_end _SEND; do + AC_TRY_LINK( + [extern void *$addr;], + [if (!$addr) return 1;], + [rb_cv_stack_end_address="$addr"; break]) +done]) +if test $rb_cv_stack_end_address != no; then + AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address) +fi + dnl Checks for library functions. AC_TYPE_GETGROUPS AC_TYPE_SIGNAL @@ -44,6 +44,10 @@ extern unsigned long __libc_ia64_register_backing_store_base; #endif #endif +#if defined _WIN32 || defined __CYGWIN__ +#include <windows.h> +#endif + void re_free_registers _((struct re_registers*)); int rb_io_fptr_finalize _((struct OpenFile*)); @@ -1408,9 +1412,16 @@ void Init_stack(addr) VALUE *addr; { -#if defined(__human68k__) - extern void *_SEND; - rb_gc_stack_start = _SEND; +#if defined(_WIN32) || defined(__CYGWIN__) + MEMORY_BASIC_INFORMATION m; + memset(&m, 0, sizeof(m)); + VirtualQuery(&m, &m, sizeof(m)); + rb_gc_stack_start = + STACK_UPPER((VALUE *)&m, (VALUE *)m.BaseAddress, + (VALUE *)((char *)m.BaseAddress + m.RegionSize) - 1); +#elif defined(STACK_END_ADDRESS) + extern void *STACK_END_ADDRESS; + rb_gc_stack_start = STACK_END_ADDRESS; #else if (!addr) addr = (VALUE *)&addr; STACK_UPPER(&addr, addr, ++addr); |