[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dynamic memory in call_external
- Subject: Re: dynamic memory in call_external
- From: David Foster <foster(at)bial1.ucsd.edu>
- Date: Mon, 25 Jan 1999 18:31:12 -0800
- Newsgroups: comp.lang.idl-pvwave
- Organization: Univ. of Calif San Diego
- References: <88lnirufne.fsf@catspaw.jpl.nasa.gov>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:13442
Vapuser wrote:
>
> 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.
I have used [m|c]alloc() and free() in CALL_EXTERNAL modules with no
problems, usually for relatively small chunks of memory. But of course
this is only for variables within the C module; you can't allocate
memory within the C module and pass it back to IDL.
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~