[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Chicken C interface
From: |
Felix |
Subject: |
Re: [Chicken-users] Chicken C interface |
Date: |
Thu, 06 Jun 2013 12:19:19 +0200 (CEST) |
From: Thomas Chust <address@hidden>
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 <address@hidden>
>>> [...]
>>> 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
- Re: [Chicken-users] Chicken C interface, (continued)
- Re: [Chicken-users] Chicken C interface, Felix, 2013/06/05
- Re: [Chicken-users] Chicken C interface, Thomas Chust, 2013/06/06
- Re: [Chicken-users] Chicken C interface, Kristian Lein-Mathisen, 2013/06/06
- Re: [Chicken-users] Chicken C interface, Thomas Chust, 2013/06/06
- Re: [Chicken-users] Chicken C interface, Kristian Lein-Mathisen, 2013/06/06
- Re: [Chicken-users] Chicken C interface, Thomas Chust, 2013/06/06
- Re: [Chicken-users] Chicken C interface, Dan Leslie, 2013/06/06
- Re: [Chicken-users] Chicken C interface, Felix, 2013/06/06
- Re: [Chicken-users] Chicken C interface,
Felix <=
- Re: [Chicken-users] Chicken C interface, Thomas Chust, 2013/06/06
- Re: [Chicken-users] Chicken C interface, Felix, 2013/06/06
- Re: [Chicken-users] Chicken C interface, Thomas Chust, 2013/06/06
Re: [Chicken-users] Chicken C interface, Felix, 2013/06/05
Re: [Chicken-users] Chicken C interface, Kristian Lein-Mathisen, 2013/06/05
Re: [Chicken-users] Chicken C interface, db05, 2013/06/05