[Ecls-list] Compiler broken?
Juan Jose Garcia-Ripoll
jjgarcia at users.sourceforge.net
Mon May 12 10:07:24 UTC 2008
On Mon, May 12, 2008 at 11:45 AM, Erik Huelsmann <ehuels at gmail.com> wrote:
> Which version did you download? The current version (in trunk/) of
> that function reads:
I used cliki.
> But, my point is: yes, I used strndup() once upon a time. However, I'm
> not using that anymore. Do you see any remaining bugs in the code
> above? (Yes, I agree the GC_malloc_atomic() would be more efficient, I
> actually thought I was using that.)
Please, do not use GC_malloc_atomic(). Actually, do not use GC_*
functions at all. Use the ECL wrappers instead.
> I'm asking because I find it hard to find the right functions for the
> operations I'm trying to perform (such as instantiating a lisp string
> from a cstring).
Yes, I should document the recommended practices some time. Sorry for
the lack of documentation about this. Roughly
make_simple_base_string(s) => creates a lisp string using the C
pointer "s". Will not duplicate data. Just keeps "s"
make_base_string_copy(s) => creates a lisp string using the data in
"char *s". Will allocate memory for this new data.
So, use the first one if you are sure that the data in "s" will
survive forever, use make_base_string_copy() otherwise.
Facultad de Fisicas, Universidad Complutense,
Ciudad Universitaria s/n Madrid 28040 (Spain)
More information about the ecl-devel