Skip to content

zunda/count-malloc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

= count-malloc
A small C code to overwrap the system's malloc/free to check
memory leaks.

== Usage
Add the following to the source code:
  #ifdef COUNT_MALLOC
  #include <count-malloc.h>
  #endif

Add count-malloc.c to the C source files to be compiled, and
compile the files with -DCOUNT_MALLOC.

The resultant executable counts mallocs and frees in the source
code.

To see details of malloc(), realloc(), and free()s on stderr
while execution, set an environment variable as
  export MALLOC_COUNT_SHOW
or
  setenv MALLOC_COUNT_SHOW

== License
Copyright (C) 2005 by zunda <zunda at freeshell.org>

Permission is granted for use, copying, modification,
distribution, and distribution of modified versions of this work
under the terms of GPL version 2 or later.

About

A small C code to overwrap the system's malloc/free to check memory leaks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages