#include <string.h>
#include <stdlib.h>
Go to the source code of this file.
Leakbug Debug Levels | |
#define | LEAKBUG_SILENT 0 |
Run leakbug silently. | |
#define | LEAKBUG_WARNINGS 1 |
Run leakbug with warnings outputted. | |
#define | LEAKBUG_ERRORS 2 |
Run leakbug with errors outputted. | |
Functions | |
void * | lbMalloc (size_t size, const char *filename, int line, int debug_level) |
Allocates memory. More... | |
void * | lbCalloc (size_t nmemb, size_t size, const char *filename, int line, int debug_level) |
Allocates and clears an array. More... | |
void * | lbRealloc (void *data, size_t size, const char *filename, int line, int debug_level) |
Reallocates memory. More... | |
void | lbFree (void *ptr, const char *filename, int line, int debug_level) |
Frees memory. More... | |
void * | lbRegister (void *ptr, unsigned int dataSize, const char *filename, int line, int debug_level) |
Registers memory for leakbug to keep track of. More... | |
void ** | lbRegisterArray (void **ptr, unsigned int dataSize, unsigned int numElements, const char *filename, int line, int debug_level) |
Registers memory in an array for leakbug to keep track of. More... | |
void | lbFreeLeaks (void) |
Frees all known leaked memory. More... | |
void | lbDumpLeaks (void) |
Displays a list of all known leaked memory. |
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Allocates and clears an array. This wraps around calloc().
|
|
Frees memory. This wraps around free().
|
|
Frees all known leaked memory. This is the easy way out of freeing memory, but it can be dangerous. You probably shouldn't use it. |
|
Allocates memory. This wraps around malloc().
|
|
Reallocates memory. This wraps around realloc().
|
|
Registers memory for leakbug to keep track of. This is used to register any memory not automatically handled by leakbug. This is useful when leakbug dumps "Freeing unknown memory" warnings in your program. The easiest way to use this is to define macros in your program. For example:
#ifdef WITH_LEAKBUG #include <leakbug.h> #define LB_REGISTER(ptr, dataSize) \ lbRegister((ptr), (dataSize), __FILE__, __LINE__, LEAKBUG_DEBUG_LEVEL) #else #define LB_REGISTER(ptr, dataSize) #endif
|
|
Registers memory in an array for leakbug to keep track of. This is used to register any memory not automatically handled by leakbug. This is useful when leakbug dumps "Freeing unknown memory" warnings in your program. The easiest way to use this is to define macros in your program. For example:
#ifdef WITH_LEAKBUG #include <leakbug.h> #define LB_REGISTER_ARRAY(ptr, dataSize, numElements) \ lbRegisterArray((ptr), (dataSize), (numElements) \ __FILE__, __LINE__, LEAKBUG_DEBUG_LEVEL) #else #define LB_REGISTER_ARRAY(ptr, dataSize, numElements) #endif
|