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

Home » Public Forums » archive » Re: Memory allocation problem using Call_external
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Memory allocation problem using Call_external [message #6243] Tue, 14 May 1996 00:00
rivers is currently offline  rivers
Messages: 228
Registered: March 1991
Senior Member
In article <Pine.SGI.3.91.960514113737.26660A-100000@leda.ieec.fcr.es>,
Oscar Chic <chic@ieec.fcr.es> writes:
>
> I'm trying to run a C program using the Call_external interface.
> The C program does some mallocs.
>
> It seems IDL doesn't permit allocate memory to C program.
> It's not possible to do this ?

There is no problem with a C program doing mallocs in call_external from IDL.

However, the mallocs must be for memory which is only used by functions inside
the C routines, it cannot be used to allocate memory for variables which are
passed to/from IDL. If you must allocate memory for IDL variables from C
functions then you must use the LINKIMAGE interface.

I generally prefer to use two CALL_EXTERNAL calls: the first to figure out how
much memory to allocate; create the variables in IDL; pass the newly allocated
variables to a second CALL_EXTERNAL call.

____________________________________________________________
Mark Rivers (312) 702-2279 (office)
CARS (312) 702-9951 (secretary)
Univ. of Chicago (312) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars3.uchicago.edu (Internet)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to scale image in idl?
Next Topic: swap_endian breaks on double

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

Current Time: Thu Oct 09 07:57:57 PDT 2025

Total time taken to generate the page: 0.64010 seconds