chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Segfault when trying to embed Scheme code (4.2.0)


From: Jeronimo Pellegrini
Subject: Re: [Chicken-users] Segfault when trying to embed Scheme code (4.2.0)
Date: Wed, 28 Oct 2009 13:38:18 -0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Tue, Oct 27, 2009 at 01:20:56PM -0400, John Cowan wrote:
> Jeronimo Pellegrini scripsit:
> 
> > define-external cannot be used for recursive definitions (probably
> > supposed to be used only for wrappers -- is this correct?)
> > My recursive define-external functions segfaulted; non-recursive
> > ones didn't.
> 
> The real issue isn't recursion, it's stack consumption.  C recursion
> consumes stack, and when Chicken calls C only a small amount of stack
> is guaranteed to be available, because of the way Scheme code uses the C
> stack (steadily consuming it and then dropping almost all of it at each
> minor GC).

Ah, OK -- now I understand it! So it actually makes sense to only
use define-external for API wrappers, so as to avoid using too much
stack space.

Thanks a lot!
I just started using Chicken and it seems like a great platform.

J.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]