From: Thomas Chust <ch...@web.de> Subject: Re: [Chicken-users] Chicken C interface Date: Thu, 06 Jun 2013 11:34:40 +0200
> On 2013-06-05 23:36, Felix wrote: >> From: Dan Leslie <d...@ironoxide.ca> >>> [...] >>> Basically, use C_alloc to allocate the memory required to host both >>> the List structure and the data it is to contain, then use the C_list >>> macro to patch it all together. >> >> Note that this code is not correct: C_alloc allocates on the C stack and the >> data will be invalid once the function returns (Sorry). If this works, then >> it is just coincidental! >> [...] > > Hello, > > when I first saw that code I thought that this must be incorrect, too. > Then I checked the CHICKEN documentation for foreign-safe-lambda and read: > > "This is similar to foreign-lambda, but also allows the called > function to call Scheme functions and allocate Scheme data-objects." > The part about allocation is wrong, I'd say. cheers, felix _______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users