On Fri, 5 Mar 2021 21:29:49 +0100
Marco Atzeri wrote:
> guile 1.8.8 is 10 years old, but it is still used by some programs
> as all the guile 2.x series were slower.
> the code on recent guile 3.0.x is different, with no recursion at all.
> 
> SCM_I_GSC_STACK_GROWS_UP=0
> AC_RUN_IFELSE([AC_LANG_SOURCE(
> [AC_INCLUDES_DEFAULT
> int
> find_stack_direction (int *addr, int depth)
> {
>    int dir, dummy = 0;
>    if (! addr)
>      addr = &dummy;
>    *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
>    dir = depth ? find_stack_direction (addr, depth - 1) : 0;
                   ^^^^^^^^^^^^^^^^^^^^
This calls find_stack_direction() recursively, isn't it?

>    return dir + dummy;
> }
> 
> int
> main (int argc, char **argv)
> {
>    return find_stack_direction (0, argc + !argv + 20) < 0;
> }])],

Recursion depth seems to be increased to more than 20.

-- 
Takashi Yano <takashi.y...@nifty.ne.jp>
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to