Skip to content
This repository has been archived by the owner on Jun 29, 2019. It is now read-only.
/ CMonitor Public archive

A small C cross-platform library that is able to keep track of memory allocations spotting memory leaks and other allocation errors.

License

Notifications You must be signed in to change notification settings

anvouk/CMonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEPRECATED: improved version available here

CMonitor

Keep an eye on every heap operation that happens in your program and spot memory leaks.

Features

  • malloc(), free(), calloc() and realloc() supported.
  • Detect where memory leaks happened.
  • Spot allocation functions misusage (e.g. asking malloc() to allocate zero bytes)
  • Quick and easy integration in your project.
  • Exstensive documentation.
  • No dependencies.

Usage

  1. Link the library to your project.
  2. At your project's root include something like this:
#include "cmonitor/cm.h"

/* enable monitoring */
#if defined(_DEBUG) || !defined(NDEBUG)
#  define malloc  cm_malloc
#  define free    cm_free
#  define calloc  cm_calloc
#  define realloc cm_realloc
#endif
  1. Done! That's it!

Examples

You can find more examples in the examples folder

About

A small C cross-platform library that is able to keep track of memory allocations spotting memory leaks and other allocation errors.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages