GitXplorerGitXplorer
a

libtrace

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Verified
b0aa32ae1a246f5a1eed98d61bf4d390449ec39d

Update README.md

aabawer committed 6 years ago
Verified
6169deaa2bfcf16ea1576ad27f72e7574ba85141

Update README.md

aabawer committed 6 years ago
Verified
de4113e55a21cafc65fa370b0c93d88249c12204

Update README.md

aabawer committed 6 years ago
Verified
3bad52cd68e002cfbba07dd255a869a5df33a779

Update README.md

aabawer committed 6 years ago
Verified
d228ff65a9aae4f156fbf4de2906ea1c7a605386

Update README.md

aabawer committed 6 years ago
Verified
aff9135f9a46ac1a67dedee06f1219d294451126

Update README.md

aabawer committed 6 years ago

README

The README file for this repository.

libtrace

A simple heap allocation tracer for linux cpp applications. Would track down memory leaks, double frees, free of unallocated memory, using delete for new [] scenarios and vice versa.

To use it with your code:

  1. create the libtrace.so by running make all at project folder.
  2. add #include "inc/trace.h" as the very first line of your main.cpp file.
  3. compile your code and link it to lib/libtrace.so, for example: g++ main.cpp -I./inc -L./lib -ltrace
  4. run your executable to be checked.

Sample output:

started tracer for MAX_ALLOCS=10000
class1.h:9:Class1(...) allocated 0x55e70dc3d280 with size 36
main.cpp:19:main(...) allocated 0x55e70dc3d2b0 with size 12
!!!leak for unfreed address 0x55e70dc3d2b0 size 12 bracket 0!!!

libtrace code does not use memory allocations to trace down memory allocations but rather a simple array of metadata. You can control the array size with -DMAX_ALLOCS=10000 (this is the default) compilation flag specifiying the maximal number of tracked allocations.