This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gc and alloca()


>>>>> "Greg" == Greg Harvey <Greg.Harvey@thezone.net> writes:

Greg> ... also referenced by other stack variables; it shouldn't be a
Greg> problem, but it also doesn't fill me with confidence.

Exactly our feelings. 

Moreover, a colleague also pointed that it may be even worse. The
portable alloca implementation expects to be called frequently
(perhaps just as alloca(0)) in order to be able to clean up. As I
understand it, it examines stack pointers to see if some of the alloca
frames need to be freed, but will this work with a multithreaded
application which has several stack spread out across the memory?

However, I think we can get rid of alloca all together. Rather than
calling alloca(), why don't we just add a local variable with the
necessary size and use that instead? I am going to try that out some
time soon.


---------------------------+--------------------------------------------------
Christian Lynbech          | Telebit Communications A/S                       
Fax:   +45 8628 8186       | Fabrik 11, DK-8260 Viby J
Phone: +45 8628 8177 + 28  | email: chl@tbit.dk --- URL: http://www.telebit.dk
---------------------------+--------------------------------------------------
Hit the philistines three times over the head with the Elisp reference manual.
                                        - petonic@hal.com (Michael A. Petonic)