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

Home » Public Forums » archive » Re: Proper pointer cleanup 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: Proper pointer cleanup question [message #34657 is a reply to message #34656] Tue, 08 April 2003 11:33 Go to previous messageGo to previous message
tam is currently offline  tam
Messages: 48
Registered: February 2000
Member
David Fanning wrote:
> M. Katz (MKatz843@onebox.com) writes:
>
>
>> Thanks! I'll write myself a full reverse-ordered cleanup routine.
>> I suppose this explicit cleanup is just as important for objects as
>> well:
>> Object pointer fields should be explicitly freed in the Cleanup
>> method.
>>
>> Question 1) But what about simple scalar pointers?
>> a = ptr_new(fltarr(10,10))
>>
>> If I set
>> a = 0
>> Will I have stranded my fltarr(), or is IDL smart enough to deallocate
>> it properly?
>
>
> You will have leaking memory. IDL, as a weakly typed
> language, always allows you to write dangerous code. :-)
>

Hi David,

I'm curious why you associate this with IDL's weak typing
(or is it just that that's another avenue for making
mistakes in IDL). Perl would reclaim memory even
though it's also weakly typed.

On a slightly different tack.... Is this situation where
users need to explicitly deallocate memory now something
that is mandated for all future versions? Or could IDL
implement garbage collection in the future?
Garbage collection seems like the kind of detail that languages at
IDL's level should take care of automatically. I hope
RSI doesn't think it's now precluded by considerations
of backwards compatibility. I don't think there's any problem
with explicit deallocations, but I could imagine someone building
programs that depend upon the existence of allocated but
unassociated memory. [Though I can't imagine why!]

Regards,
Tom McGlynn
[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
Previous Topic: Pb to work with huge files
Next Topic: Re: Where is the trick in objects

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

Current Time: Sat Oct 11 18:47:44 PDT 2025

Total time taken to generate the page: 2.08011 seconds