On Fri, Aug 1, 2008 at 12:11 AM, Shawn Rutledge
<[EMAIL PROTECTED]> wrote:
> On Thu, Jul 31, 2008 at 1:39 PM, felix winkelmann <[EMAIL PROTECTED]> wrote:
>> The C_alloc is a macro that actually does alloca(), so you are allocating
>> stack data that is not live after returning from the function. You will
>
> Hmm, I thought C_return made that OK, because it's normal for objects
> to live on the stack.  But you are saying that's only true if I use
> foreign-primitive?

C_return does other things but does not save live data from the stack
to the heap.

>
>> either have to use `foreign-primitive`(to create a CPS function), or
>
> Why don't you prefer that approach?

Well, the pass-the-box approach appeared simpler, but foreign-primitive
is probably the cleaner approach and doesn't require you to create
a wrapper function.


cheers,
felix


_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to