Skip to content

NotYaiba/leak_check_xmalloc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

leak_check_xmalloc

An alternative to valgrind.

Include "malloc.h" after every <stdlib.h> in your code.

Include "malloc.h" in your main too.

Add a line leakcheck(); or leakcheckfull(); before your main's return.

It should be something like this:

#include "malloc.h"

int		main()
{
	/* your code */
	leakcheck(); //or leakcheckfull();
	return (0);
}

If you're also using exit() in your code, compile everything with the following define:

gcc ... -D L_C=N //for leakcheck();

gcc ... -D L_C=F //for leakcheckfull();

About

An alternative to valgrind

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 100.0%