[gambit-list] compiling fib

Marc Feeley feeley at iro.umontreal.ca
Fri Jan 21 14:47:38 EST 2011


On 2011-01-21, at 2:38 PM, Marc Feeley wrote:

> 
> On 2011-01-21, at 1:59 PM, Bradley Lucier wrote:
> 
>> <Explanation by Marc about padding in call frames deleted.>
>> 
>> Ah, so this is the cost that all calls incur in Gambit so that one can implement call/cc?
> 
> You could say that.  But the "cost" is just more memory usage.  And this extra memory is not touched (written/read) in the usual case (i.e. call/cc is not called).  Very probably, the main run time cost is that the caches will be less efficient at accessing variables on the stack, but that is hard to measure except for specific benchmarks.

Let me add that gcc (at least on the Mac) also pads stack frames on multiples of 16 bytes.  If you write assembly code that doesn't align properly and that calls a C library function, the code will crash.

Marc




More information about the Gambit-list mailing list