chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] FFI and stack use


From: Thomas Bushnell BSG
Subject: Re: [Chicken-users] FFI and stack use
Date: Wed, 22 Jul 2009 11:59:05 -0700

On Tue, 2009-07-21 at 23:37 -0400, John Cowan wrote:
> In fact, it's unpredictable how much C stack you have, because each compiled
> Scheme function invokes its successor, leaving garbage return addresses,
> saved registers, etc. on the C stack.  So just before calling a function
> that allocates lots of C stack, call (gc #f) to force a minor GC.  
> Alternatively,
> use the -nursery switch at compile time or the -:s switch at run time to
> force a large stack.

But this doesn't seem right.  Let's suppose the kernel stack limit is
16MB, and the Chicken Scheme stack size is set to its default of 64K.

Then when my function is invoked, the kernel is still willing to expand
the stack up to 15 MB.  So there isn't a serious problem here. 

The only reason this wouldn't work is if chicken is moving off onto some
stack other than the default stack the kernel gave it, but afaict,
nothing of the kind happens.

Thomas






reply via email to

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