[Ecls-list] Consing source identified
Juan Jose Garcia-Ripoll
jjgarcia at users.sourceforge.net
Sun Feb 10 19:41:49 UTC 2008
On Feb 10, 2008 7:54 PM, Julian Stecklina <der_julian at web.de> wrote:
> Will this be available to user code utilizing DYNAMIC-EXTENT
Right now, frames are only generated internally and in some compiled
code. Users are not allowed to create them. At least not right now.
> You talk about creating these frames on the interpreter stack. Could you
> elaborate on that? My simple idea would be to use alloca or perhaps you
> use it internally?
Hmm, perhaps I should explain how ECL works with greater detail. When
calling a function, ECL needs to build a C array of lisp objects. Once
this array is built, one can call the C function using this data in a
general and portable way (See src/c/apply.d), which can be actually
improved with little assembler.
ECL creates this array in a larger, adjustable array, which is used by
the lisp interpreter. We do it so to avoid alloca() and other
nonportable and unsafe techniques. The advantange of the new
implementation is that having frames available as data structure
allows us to create and manipulate these sections of the array in a
safer way, as well as reusing the arrays in more than one function
Other users have suggested using lists with dynamical extent,
allocated in the stack, to do the same thing. I am still pondering
that. However, it does not improve the issue mentioned before, because
the function calls use C arrays, not lists, so one still has to
duplicate the data.
Facultad de Fisicas, Universidad Complutense,
Ciudad Universitaria s/n Madrid 28040 (Spain)
More information about the ecl-devel