OS4 DepotLogo by Alessandro Bacchia 
(anonymous IP: 3.137.181.69,2258) 
 HomeRecentStatsSearchSubmitUploadsMirrorsContactInfoDisclaimerConfigAdmin
 Menu

 Features
   Crashlogs
   Bug tracker
   Locale browser
 

 Categories

   o Audio (343)
   o Datatype (51)
   o Demo (203)
   o Development (602)
   o Document (24)
   o Driver (97)
   o Emulation (149)
   o Game (1011)
   o Graphics (500)
   o Library (118)
   o Network (234)
   o Office (66)
   o Utility (932)
   o Video (69)

Total files: 4399

Full index file
Recent index file

 Links

  Amigans.net
  OpenAmiga
  Aminet
  IntuitionBase


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 2008
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: 375  (Current version)
375  (Accumulated)
Votes: 0 (0/0)  (30 days/7 days)

Show comments Show snapshots Show videos Show content Show crashlogs Replace file 
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 © 2004-2024 by Björn Hagström All Rights Reserved