Re: INFO - memory leaks

From: Daniel Koepke (dkoepke@CALIFORNIA.COM)
Date: 08/15/97


On Thu, 14 Aug 1997, Tom Dailey wrote:

-+Oh, I did say it was a "donated" copy didn't I? free is always better than
-+$1500, eh??....

Was this donation made by a player of your MUD to you?  Was this donation
made by someone who had a single-user license on the product?  Breaking two
laws is always worse than breaking one... [sorry, I had to do it]

Anyway, to answer the actual use of the mem_track.  You change the CREATE(),
RECREATE(), and FREE() macros to use it and it will serve to log any use of
the CREATE(), RECREATE(), and FREE() macros; providing line number, and
whatever else information you want it to [you just have to code it is all].
While it won't point you automatically to a memory leak and tell you what
line it was on, and all of that, it will help you track them down by keeping
tabs on all memory.  Actually, you can have keep track of memory leaks by
having it log everything in the mem_track array/list when the mud shuts
down.  During the time the game is running, you add to mem_track anything
that is CREATE'd and you remove the mem_track data when that structure is
FREE'd.  When you write out the mem_track log at the end, you'll get logs
on anything CREATE'd but not FREE'd (and with a bit of changes to the FREE
macro, anything FREE'd but not CREATE'd).

This will help track down memory leaks and double FREEs without too much
code [a linked list and a few lines to CREATE, RECREATE, and an added
FREE macro; then the function to log the data added just before termination
of the game], $1500, or breaking any licenses on software....:P~


--
Daniel Koepke -:- dkoepke@california.com -:-  [Shadowlord/Nether]
Think.


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST