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

Home » Public Forums » archive » How to delete a variable
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: How to delete a variable [message #88418 is a reply to message #88412] Wed, 23 April 2014 10:42 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On Wednesday, April 23, 2014 10:30:59 AM UTC-4, Fabien wrote:
> Hi All,
>
>
>
> why did Wayne say that Coyote's UNDEFINE is "less elegant" than the
>
> PTR_NEW() stuff? I am using undefine very often and I was just wondering
>
> if there's a more efficient (but general!) way to get rid of unused
>
> variables within a routine
>

I was using elegant to mean "less coding", i.e. the single statement

Heap_Free, PTR_NEW(x , /No_Copy)

will free any type of IDL variable (so no need to check for the variable type), and the use of SCOPE_VARFETCH() allows one to loop over an arbitrary number of supplied parameters without writing a special case for each one.

But I think that nearly all the CPU time in these procedures is taken up with actually freeing the memory, so I am fairly certain that that delvarx.pro is no more efficient than undefine.pro. And my original reason for the post was that some IDL V7.0 Linux users found that Heap_Free could be extremely slow. I still don't know the cause of this problem (it is only known to occur so far on CentOS Linux with IDL 7.0), but it does suggest that the Coyote undefine.pro might be more reliable than delvarx.pro

--Wayne
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: colorbar
Next Topic: Upload a file on a website

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

Current Time: Wed Oct 08 14:20:18 PDT 2025

Total time taken to generate the page: 0.00220 seconds