comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Building sharable object libraries for CALL_EXTERNAL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Building sharable object libraries for CALL_EXTERNAL [message #14699 is a reply to message #14670] Mon, 22 March 1999 00:00 Go to previous messageGo to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
Octavi Fors wrote:

> Taking a look at the routine.c code (it's in the first message), I
> noticed that the
> **pointer (output) I'm passing back to IDL is malloced in the
> C-routine, in line:
>
> output=(float **)malloc(4*n);
> for(i=0;i<n;i++) output[i]=(float*)malloc(4*x*y);
>
> Is there something wrong with this?

I thought it was a no-no to allocate memory inside of an external
routine, that is to be passed back to IDL. The Advanced Developer's
Guide has always stated that all memory must be allocated prior to
calling the routine. Is that not always the case?

Even if you get this to compile, I would be very wary of the results.

Dave
--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Writing on X without X device (!)
Next Topic: Re: Colour maps ... (BYTE_SCALE)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 16:19:57 PDT 2025

Total time taken to generate the page: 0.40244 seconds