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

Home » Public Forums » archive » Re: dynamic memory in 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: dynamic memory in call_external [message #14169 is a reply to message #14157] Tue, 26 January 1999 00:00 Go to previous messageGo to previous message
rivers is currently offline  rivers
Messages: 228
Registered: March 1991
Senior Member
In article <88lnirufne.fsf@catspaw.jpl.nasa.gov>, Vapuser <vapuser@catspaw.jpl.nasa.gov> writes:
>
>
> I have someone in my office who wants to know:
>
> Is it advisable to create and destroy memory within a CALL_EXTERNAL
> routine? (that is, can one safely use malloc and free?) Or must one
> make the routine(s) in question LINKIMAGE routines and the idl memory
> management routines (IDL_MEMAlloc, IDL_MEMfree and IDL_GetScratch)
> available in that environment.

No, you should not create and destroy memory within CAll_EXTERNAL. The reason
is that when you use CALL_EXTERNAL you are passed only the address of the data
storage part of the IDL variable. You are not passed other important pieces of
information for that variable, such as how big it is, what the data type is,
etc. If you create and destroy memory you will only change the pointer, but
not the other descriptive information. It might work OK if you are sure you
won't change the size or type of the IDL variable, but I would not bet on it.

> Secondly, can one create an array in IDL (in the interpreter) that
> is page aligned (i.e. as if one had done it using the 'valloc' version
> of malloc in C) which can then be passed down into the CALL_EXTERNAL
> routine.

I don't think so.

____________________________________________________________
Mark Rivers (773) 702-2279 (office)
CARS (773) 702-9951 (secretary)
Univ. of Chicago (773) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars.uchicago.edu (e-mail)

or:
Argonne National Laboratory (630) 252-0422 (office)
Building 434A (630) 252-0405 (lab)
9700 South Cass Avenue (630) 252-1713 (beamline)
Argonne, IL 60439 (630) 252-0443 (FAX)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Concurrent CORBA calls
Next Topic: Check mark on menu bar pull down item?

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

Current Time: Wed Oct 08 19:10:27 PDT 2025

Total time taken to generate the page: 0.00553 seconds