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

Home » Public Forums » archive » Re: pointer question
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: pointer question [message #24287 is a reply to message #24285] Sun, 25 March 2001 09:24 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
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
> like
>
> 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.

http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/rec_ptr_free.tar.gz



For further routines and licensing please look at
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml

regards

Reimar

--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg1/
=============================================
a IDL library at ForschungsZentrum J�lich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml

http://www.fz-juelich.de/zb/text/publikation/juel3786.html
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: widget fonts
Next Topic: *.cdf files

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

Current Time: Sat Oct 11 20:17:45 PDT 2025

Total time taken to generate the page: 0.48051 seconds