OS4 DepotLogo by DaveyD 
(anonymous IP: 18.223.171.12,0) 
 HomeRecentStatsSearchMirrorsContactInfoDisclaimerConfigAdmin
 Menu

 Features
   Crashlogs
   Bug tracker
   Locale browser
 

 Categories

   o Audio (343)
   o Datatype (51)
   o Demo (203)
   o Development (596)
   o Document (22)
   o Driver (97)
   o Emulation (147)
   o Game (1004)
   o Graphics (497)
   o Library (115)
   o Network (232)
   o Office (66)
   o Utility (923)
   o Video (69)

Total files: 4365

Full index file
Recent index file

 Links

  Amigans.net
  OpenAmiga
  Aminet
  UtilityBase
  IntuitionBase
  AmigaBounty


Support the site


 Readme for:  Development » Debug » memtrace.lha

Memtrace

Description: memtrace - a memory debugger
Download: memtrace.lha       (TIPS: Use the right click menu if your browser takes you back here all the time)
Size: 186kb
Date: 15 Apr 08
Author: Markus Wolf, AmigaOS 4.0 compile by Spot / Up Rough
Submitter: Spot / Up Rough
Email: spot/triad se
Homepage: http://www-user.tu-chemnitz.de/~womar/projects/
Category: development/debug
License: Other
Distribute: yes
Min OS Version: 4.0
FileID: 3620
 
Comments: 0
Snapshots: 0
Videos: 0
Downloads:  (Current version)
 (Accumulated)

[Show comments] [Show snapshots] [Show videos] [Show content] [Show crashlogs] 
This port was requested by Raziel, so, enjoy!(?) /spot

Author:  Markus Wolf
Web:     http://www.murkymind.de
Version: 1.0 (20-nov-2006)

The "memtrace" include files provides overview over dynamic memory allocation
and deallocation for C/C++ code.
A C++ compiler is required. It is intended for debugging and should be excluded
(deactivated) for final project compilation.

Files:
"memtrace.h"            : The only file to include into a project (include file
tree)
"memtrace_internal.h"   : "MemTrace" class definition, "MemTrace" configuration
via preprocessor directives, method descriptions
"memtrace_internal.cpp" : "MemTrace" methods, must be compiled as separat object
so a single global ("extern") instance can be used for a whole project



How to use:
-----------
- Edit the preprocessor configuration in "memtrace_internal.h" to your needs.
- Compile "memtrace_internal.cpp" as separate object. It includes the one and
only instance "memtrace" of class "MemTrace".
- Include "memtrace.h" in the project where allocation should be watched in the
following code. You don't have to change any code in your project.
  "memtrace.h" defines an external reference to the "memtrace" instance.
- Link the "memtrace_internal.cpp" compiled object to your project when
compiling.


What it does:
----------------
- Watching your (de)allocations with file name and line of the appropriate
statement in your code, finding memory leaks.
- The "memtrace" instance has tables. Each allocation in your project creates a
table entry.
  Which table is used, depends on the way of allocation: "new", "new[]",
"malloc"
- Each deallocation tries to delete the entry from the appropriate list, which
may be successful or not.
- Actions and errors can be logged to a stream of choice.
- prints and logs the location of the (de)allocation action (file, line)
- If entries are left in the table at program end, these are potential memory
leaks, which means one of the following:
   * memory block is not deallocated
   * illegal deallocations were used for the allocation type
("free"/"delete"/"delete[]" mixing)
   * "memtrace" was locked during (de)allocation and was unable to trace -> not
a memory leak
- can check if a byte range (with address) is within allocated space registered
in a list (via separate function call).


Note:
-----
- In order to start tracing memory (de)allocation, the "memtrace" instance must
be "unlocked"!
- Read the *.h files.

Copyright (c) 2004-2024 by Björn Hagström All Rights Reserved
Amiga OS and its logos are registered trademarks of Hyperion Entertainment