Fix bug with expanding text.
[geda-pcb/pcjc2.git] / src / free_atexit.h
blobbb5d6e7ff337bfdf56811a02f1ac555ee21ba31e
1 /*!
2 * \file src/free_atexit.c
4 * \brief .
6 * This tiny library is to assist cleaning up harmless memory leaks
7 * caused by (growing) buffers allocated in static variables in
8 * functions.\n
9 * The library provides leaky_ prefixed variants of the common
10 * allocation routines.\n
11 * These wrappers will remember all pointers they return and can free
12 * all memory used, at the end of the application.
15 #include <stdlib.h>
17 #ifdef NDEBUG
18 #define leaky_init()
19 #define leaky_uninit()
20 #define leaky_malloc(size) malloc(size)
21 #define leaky_calloc(nmemb, size) calloc(nmemb, size)
22 #define leaky_realloc(old_memory, size) realloc(old_memory, size)
23 #define leaky_strdup(str) strdup(str)
24 #else
26 void leaky_init (void);
27 void leaky_uninit (void);
28 void *leaky_malloc (size_t size);
29 void *leaky_calloc (size_t nmemb, size_t size);
30 void *leaky_realloc (void* old_memory, size_t size);
31 char *leaky_strdup (const char *src);
34 #endif