[linrad] Re: Memory leakage.

2006-04-19 Thread Joseph B. Fitzgerald
 There is (usually) a destructor


Richard,

Please note that X, like most Unix software that has been around for any
length of time, is written in C, not C++.  Consequently, one often has to
explicitly call some sort of close() function to clean up resources rather
than relying on a destructor.

-Joe KM1P

#
This message is sent to you because you are subscribed to
  the mailing list linrad@antennspecialisten.se.
To unsubscribe, E-mail to: [EMAIL PROTECTED]
To switch to the DIGEST mode, E-mail to [EMAIL PROTECTED]
To switch to the INDEX mode, E-mail to [EMAIL PROTECTED]
Send administrative queries to  [EMAIL PROTECTED]



[linrad] Re: Memory leakage

2006-04-18 Thread Joseph B. Fitzgerald
What is the meaning of lost memory ? Is it a part of
memory space that will eventually be swapped to disk?
Presumably there is no owner to it, will it just
accumulate until the next reboot ?

In valgrind's terminology, lost memory is synonymous with a memory
leak - memory which has been malloc'ed but not free'ed.  In general, the
operating system will reclaim this memory when the program terminates -
you do not necessarily need to wait until the next reboot. 

 That being said, it might be possible for you to ask (possibly
indirectly) X to allocate memory and then linrad could exit and leave X
holding the bag so to speak.   In that case, the memory might not be
reclaimed until X is restarted.  I am not particularly familiar with X
programming, but that can be an issue with libraries in general.   Once, I
missed a note buried deep in the comments of a header file.  It read
something like:

/*pointer pBlarg allocated by foo(), you must free this with free()*/

That cost me a week of debugging time!  There could be some similar
documentation for an X library function.

There is a  nice article at
http://www.o-hand.com/~iain/valgrind-gtkhtml.html which may shed some
light on the subject.

-Joe KM1P

#
This message is sent to you because you are subscribed to
  the mailing list linrad@antennspecialisten.se.
To unsubscribe, E-mail to: [EMAIL PROTECTED]
To switch to the DIGEST mode, E-mail to [EMAIL PROTECTED]
To switch to the INDEX mode, E-mail to [EMAIL PROTECTED]
Send administrative queries to  [EMAIL PROTECTED]