[Ecls-list] Foreign variables setting problem

Juan Jose Garcia Ripoll lisp at arrakis.es
Mon Oct 24 03:28:10 UTC 2005


On Mon, 2005-10-24 at 11:52 +0200, Goffioul Michael wrote:
> What about si:free-foreign-data, which uses cl_dealloc(). Is it correct
> to use it on memory that has been malloc'ed? (At least when ECL use its
> internal GBC, in the other case cl_dealloc is just empty).

One should use free(). For that maybe one should add a flag in
foreign_data, as in

struct ecl_foreign {		/*  user defined datatype  */
	HEADER1(malloced);	/*  allocated with malloc()?  */
	cl_object tag;		/*  a tag identifying the type  */
	cl_index size;		/*  the amount of memory allocated  */
	char *data;		/*  the data itself  */
};

Regards,

Juanjo	





More information about the ecl-devel mailing list