pcb 4.1.1
An interactive printed circuit board layout editor.

free_atexit.h File Reference

#include <stdlib.h>
Include dependency graph for free_atexit.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void leaky_init (void)
 Set up atexit() hook.
void leaky_uninit (void)
 Free all allocations.
void * leaky_malloc (size_t size)
 Allocate memory, remember the pointer and free it after exit from the application.
void * leaky_calloc (size_t nmemb, size_t size)
 Same as leaky_malloc but this one wraps calloc().
void * leaky_realloc (void *old_memory, size_t size)
 Reallocate memory, remember the new pointer and free it after exit from the application.
char * leaky_strdup (const char *src)
 strdup() using leaky_malloc().

Function Documentation

void* leaky_calloc ( size_t  nmemb,
size_t  size 
)

Same as leaky_malloc but this one wraps calloc().

Definition at line 81 of file free_atexit.c.

References leaky_malloc().

Here is the call graph for this function:

void leaky_init ( void  )

Set up atexit() hook.

Can be avoided if leaky_uninit() is called by hand.

Definition at line 143 of file free_atexit.c.

References leaky_uninit().

Referenced by main().

Here is the call graph for this function:

void* leaky_malloc ( size_t  size)

Allocate memory, remember the pointer and free it after exit from the application.

Definition at line 66 of file free_atexit.c.

References free_list, free_size, malloc(), and realloc().

Referenced by leaky_calloc(), leaky_realloc(), and leaky_strdup().

Here is the call graph for this function:

void* leaky_realloc ( void *  old_memory,
size_t  size 
)

Reallocate memory, remember the new pointer and free it after exit from the application.

Definition at line 94 of file free_atexit.c.

References free_list, leaky_malloc(), and realloc().

Here is the call graph for this function:

char* leaky_strdup ( const char *  src)

strdup() using leaky_malloc().

Definition at line 116 of file free_atexit.c.

References leaky_malloc(), and len.

Here is the call graph for this function:

void leaky_uninit ( void  )

Free all allocations.

Definition at line 127 of file free_atexit.c.

References free_list, and free_size.

Referenced by leaky_init().