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

Home » Public Forums » archive » Re: DLM memory space behavior.
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: DLM memory space behavior. [message #30630] Tue, 14 May 2002 01:47
Nigel Wade is currently offline  Nigel Wade
Messages: 286
Registered: March 1998
Senior Member
Ed Wright wrote:

>
> To: IDL
> From: Ed Wright
>
> A question concerning memory space and dlm usage. I am working to separate
> a set of test code from my dlm project into a second dlm. The test code
> creates/loads/deletes a number of temporary test files. I discovered a
> file loaded by C code from one dlm cannot be accessed by C code in another
> dlm. (All file loading/unloading occurs within C code, not the IDL
> environment.)
>
> Is this correct?
>

I wouldn't have thought so. I'm not totally sure what you mean by "a file
loaded by C code", but memory allocated within one DLM shoule be accessible
to any other DLM. I know this is the case with UNIX, but I have no idea
about Windows.

The days of overlays are long gone, and all memory should be available at
any location in the code. If you have some memory allocated within one DLM,
that memory is still part of the overall memory space of the application
and another DLM should be able to access it provided it can get a valid
pointer to the memory.

How are you creating the space to store the contents of the file?

I'd have thought you could declare a global variable in the DLM that
allocates the memory, and extern this variable in the other DLM. You then
need to build the DLMs so that global symbols are exported. This can be
done with the flavours of UNIX I'm familiar with.

Alternatively you can return a pointer to IDL from one DLM and pass it on
to the other DLM. I do this with pointers returned by malloc to pass memory
locations between DLMs.

--
-----------------------------------------------------------
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523568, Fax : +44 (0)116 2523555
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Matlab emacs package similar to idlwave
Next Topic: Problem with MIN_CURVE_SURF

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

Current Time: Thu Oct 09 16:07:43 PDT 2025

Total time taken to generate the page: 1.03832 seconds