Home

Awesome

Dynamic Memory Tracker (DMT) Library

Description

A small C library for detecting memory leaks, tracking memory usage and detecting invalid frees or reallocs. The library consists of two files (dmt.c and dmt.h) and provides wrappers for the 4 main dynamic memory functions in C (malloc, calloc, realloc and free). The library is currently thread unsafe.

Usage

The library should be dropped inside a C project and compiled along with it. The library provides the following macros and functions:

The wrapper macros (dmt_malloc, dmt_calloc, dmt_realloc and dmt_free) should be used in place of the functions which they wrap (malloc, calloc, realloc and free). Their arguments and return values match those of the functions they wrap.

Additional options can be set by defining the following macros:

License

This library is free software; you can redistribute it and/or modify it under the terms of the MIT license. See LICENSE for details.