comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam@spam.com>
Subject: Re: Returning data from Ada to C
Date: Mon, 16 May 2005 05:03:30 GMT
Date: 2005-05-16T05:03:30+00:00	[thread overview]
Message-ID: <CQVhe.2345$Ri4.352@newsread1.news.pas.earthlink.net> (raw)
In-Reply-To: <vv5g815hgchp241e34go6f91uprsm30a9e@4ax.com>

Dave Thompson wrote:

> Not if Sols is a procedure-local variable, as in the OP's code, and
> the (C) caller intends to dereference the resulting pointer, as it
> does. For the storage to remain valid for the caller to access, it
> needs either to be (in a package) at library level, or dynamically
> allocated in Ada by 'new' (and some provision e.g. another callable
> Ada routine for deallocating it if necessary) or by hand-built Ada
> call to C's malloc in which case the C code can safely free() it.

This was discussed in another message in the thread.

-- 
Jeff Carter
"You've got the brain of a four-year-old boy,
and I bet he was glad to get rid of it."
Horse Feathers
47



      reply	other threads:[~2005-05-16  5:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-03 23:49 Returning data from Ada to C igor.kh
2005-05-04  4:49 ` Jeffrey Carter
2005-05-04 13:45   ` Igor Khavkine
2005-05-04 13:58     ` Alex R. Mosteo
2005-05-06  3:36     ` Jeffrey Carter
2005-05-07 22:12       ` igor.kh
2005-05-08  2:07         ` Jeffrey Carter
2005-05-08 19:58           ` Jeffrey Carter
2005-05-08  9:41         ` Martin Dowie
2005-05-08 14:55           ` Ludovic Brenta
2005-05-08 14:58             ` Ludovic Brenta
2005-05-09 22:49               ` igor.kh
2005-05-10 12:48                 ` Ludovic Brenta
2005-05-16  4:35   ` Dave Thompson
2005-05-16  5:03     ` Jeffrey Carter [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox