View Single Post
 
Old 06-22-2014, 10:15 PM
whatsup whatsup is offline Windows 7 64bit Office 2010 32bit
Competent Performer
 
Join Date: May 2014
Posts: 137
whatsup will become famous soon enough
Default

Quote:
In summary, I cant see any reason to set local objects to nothing at the end of a sub. Even if there is an error and the sub doesn't complete normally, or if there are structures that fool the reference counting, everything is still cleaned up in the former and the set to nothing does nothing extra in the latter.
Ok, that way I agree. Still, if short of memory you can deallocate memory earlier using Set to Nothing. But otherwise it's done automatically when leaving the sub. That's shown nicely in Run11, when you skip the part Set to nothing, the Terminate-Event of the class is still triggered (but I see you mentioned this already in your post)

And I remember very well that you argue against - therefore we are here But I enjoy. That way I learn quite a lot about memory, which really is due in regard that obviously MS has improved on the subject.

Yeah, the VarPtr of an object - honestly I don't know if it makes sense. I tried to figure out whether the Mem_ReadHex of VarPtr points to the ObjPtr by converting the HexToDec, but was disapointed by the result. Even worse HexToDec comes up with negative figures, so what shall we make of this? Maybe Val("&H"&...) isn't the right tool?

Quote:
Why crash when the source pointer is set to zero? Its only a read... Any thoughts?
I don't know, maybe because it doesn't exist a pointer "Zero" within memory? Maybe "Zero" makes a program turn off the track ways before, but we are interfering far behind the curtain where nothing is provided anymore to reject the attempt? In fact you cannot copy anything if the pointer is Zero, therefore I just excluded it from any attempt.

Documentation is a selfish thing - I know after several days I will end up with x files not knowing anymore what I intended to achieve, just testing, playing, ... But one thing is sure, the time I used formatting the immediate window, I rather would have spent for another output. But for the moment it's ok.

Me as well, I spent a lot of time searching the web for information about "memory" and related words, but google misunderstands what I'm looking for, and mostly comes up with things I'm not interested in.
Reply With Quote