[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pointer question
- Subject: Re: pointer question
- From: Reimar Bauer <r.bauer(at)fz-juelich.de>
- Date: Sun, 25 Mar 2001 19:24:43 +0200
- Newsgroups: comp.lang.idl-pvwave
- Organization: Forschungszentrum Juelich GmbH
- References: <email@example.com>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:24122
Ted Graves wrote:
> Hi all,
> Another lurker question ... let's say you define a pointer using the PTR_NEW
> function and assign to a variable x. As long as you keep track of x and don't
> reassign x and lose the pointer to the heap variable, things are great. You
> can remove the heap variable from memory using the PTR_FREE procedure.
> But now let's say i have a function TEST that takes a pointer as an argument,
> and i want to create a pointer on the fly to use in TEST. So i do something
> result = TEST(PTR_NEW(value))
> where value is whatever i want the heap variable to be. What happens to the
> heap variable assigned in this statement after TEST returns? I'm assuming
> from that because of the way it was created, a heap variable now exists that i
> can't easily get rid of without using HEAP_GC.
> Me and my sloppy programming ...
> Ted Graves
> Magnetic Resonance Science Center, UCSF
We have a routine in our library which I am using often in this case.
For further routines and licensing please look at
Institut fuer Stratosphaerische Chemie (ICG-1)
a IDL library at ForschungsZentrum Jülich