diff options
| author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-02-11 07:12:02 +0000 |
|---|---|---|
| committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-02-11 07:12:02 +0000 |
| commit | f12b89151d9d135fe345c6423fc804ed1c6d46c2 (patch) | |
| tree | 2b42fba0fadc6291e93dd3e97876fe3a97de8f9a /eval.c | |
| parent | 0095a86b0da752010703b4c97e16a35418a82d69 (diff) | |
| download | ruby-f12b89151d9d135fe345c6423fc804ed1c6d46c2.tar.gz ruby-f12b89151d9d135fe345c6423fc804ed1c6d46c2.tar.xz ruby-f12b89151d9d135fe345c6423fc804ed1c6d46c2.zip | |
* eval.c (stack_length): use __builtin_frame_address() only if
GCC and i386 CPU.
* gc.c (rb_gc, Init_stack): ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
| -rw-r--r-- | eval.c | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -22,6 +22,25 @@ #include "st.h" #include "dln.h" +/* Make alloca work the best possible way. */ +#ifdef __GNUC__ +# ifndef atarist +# ifndef alloca +# define alloca __builtin_alloca +# endif +# endif /* atarist */ +#else +# if defined(HAVE_ALLOCA_H) +# include <alloca.h> +# elif !defined(alloca) +char *alloca(); +# endif +#endif /* __GNUC__ */ + +#ifdef _AIX +#pragma alloca +#endif + #ifdef HAVE_STDARG_PROTOTYPES #include <stdarg.h> #define va_init_list(a,b) va_start(a,b) @@ -4128,7 +4147,7 @@ stack_length(p) alloca(0); # define STACK_END (&stack_end) #else -# if defined(__GNUC__) && !defined(__alpha__) && !defined(__APPLE__) +# if defined(__GNUC__) && defined(__i386__) VALUE *stack_end = __builtin_frame_address(0); # else VALUE *stack_end = alloca(1); |
