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

Home » Public Forums » archive » Re: Do we need PTR_FREE anymore?
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: Do we need PTR_FREE anymore? [message #71918] Thu, 29 July 2010 08:52
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Jul 29, 7:33 am, Chris <beaum...@ifa.hawaii.edu> wrote:
> My guess is that IDL periodically checks for reference-less heap
> variables and frees them, in which case there is a "limbo" period for
> such objects. If some piece of code is creating and destroying lots of
> heap memory (in a long loop, e.g.), then maybe it makes sense to clean
> up manually?

That is one possible implementation. But they could also be erased at
the moment their reference count reaches 0, which to me seems to be
the case in IDL, judging from the help on the garbage collector.
Re: Do we need PTR_FREE anymore? [message #71922 is a reply to message #71918] Thu, 29 July 2010 03:33 Go to previous message
Chris[6] is currently offline  Chris[6]
Messages: 84
Registered: July 2008
Member
On Jul 28, 3:48 pm, David Fanning <n...@dfanning.com> wrote:
> wlandsman writes:
>> The help files give one obscure example where automatic garbage
>> collection fails -- when "two objects or pointers refer to each other,
>> but no other object or pointer refers to either".     Is there ever
>> any other reason (e.g. performance issues) to explicitly call PTR_FREE
>> anymore?
>
> Perhaps you just want to feel like you are a member
> of the professional programming fraternity.  
>
> Cheers,
>
> David
>
> P.S. Or, you don't want to feel like a dope if someone
> runs your code in a version of IDL older than 8.0. :-)
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

My guess is that IDL periodically checks for reference-less heap
variables and frees them, in which case there is a "limbo" period for
such objects. If some piece of code is creating and destroying lots of
heap memory (in a long loop, e.g.), then maybe it makes sense to clean
up manually?

chris
Re: Do we need PTR_FREE anymore? [message #71927 is a reply to message #71922] Wed, 28 July 2010 18:48 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
wlandsman writes:

> The help files give one obscure example where automatic garbage
> collection fails -- when "two objects or pointers refer to each other,
> but no other object or pointer refers to either". Is there ever
> any other reason (e.g. performance issues) to explicitly call PTR_FREE
> anymore?

Perhaps you just want to feel like you are a member
of the professional programming fraternity.

Cheers,

David

P.S. Or, you don't want to feel like a dope if someone
runs your code in a version of IDL older than 8.0. :-)



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: "Fatal error: IDL has encountered a fatal error and will now exit."
Next Topic: Another small V8.0 bug

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

Current Time: Sun Oct 12 00:01:51 PDT 2025

Total time taken to generate the page: 0.01074 seconds