[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Building sharable object libraries for CALL_EXTERNAL
- Subject: Re: Building sharable object libraries for CALL_EXTERNAL
- From: "Scott Lett" <slett(at)holisticmath.com>
- Date: Mon, 22 Mar 1999 21:28:23 -0600
- Newsgroups: comp.lang.idl-pvwave
- Organization: World Trade Network, Inc.
- References: <36E9649A.7F5C8B65@fajnm1.am.ub.es> <7cc6dj$fum$1@agate.berkeley.edu> <36EAAE98.8F975873@fajnm1.am.ub.es> <36F6FC2A.54D0@bial1.ucsd.edu>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:14035
I don't think this is true. Functions like IDL_MakeStruct(),
IDL_ImportArray() and IDL_ImportNamedArray(),
are handy for building IDL variables with memory you allocate.
However, the following code will most likely not produce the desired
results. Reading the External Development Guide is a recommended first
step, especially the chapter on IDL Internals: Variables.
> output=(float **)malloc(4*n);
> for(i=0;i<n;i++) output[i]=(float*)malloc(4*x*y);
Scott
>
> 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
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~