ELinks 0.18.0
memory_list Struct Reference

memory_list is used to track information about all allocated memory belonging to something. More...

#include <memlist.h>

Data Fields

int n
 
void * p [1]
 

Related Symbols

(Note that these are not member symbols.)

struct memory_listdebug_getml (char *file, int line, void *p,...)
 Create a memory list.
 
void debug_add_to_ml (char *file, int line, struct memory_list **ml,...)
 Add elements to a memory list.
 
void debug_add_one_to_ml (char *file, int line, struct memory_list **ml, void *p)
 
void freeml (struct memory_list *ml)
 Free elements and memory list.
 

Detailed Description

memory_list is used to track information about all allocated memory belonging to something.

Then we can free it when we won't need it anymore, but the one who allocated it won't be able to get control back in order to free it himself.

Friends And Related Symbol Documentation

◆ debug_add_one_to_ml()

void debug_add_one_to_ml ( char * file,
int line,
struct memory_list ** ml,
void * p )
related

◆ debug_add_to_ml()

void debug_add_to_ml ( char * file,
int line,
struct memory_list ** ml,
... )
related

Add elements to a memory list.

If memory list exists, it enlarges it, else it creates it. if there's no elements or first element is NULL, it does nothing. It always stops at first NULL element.

◆ debug_getml()

struct memory_list * debug_getml ( char * file,
int line,
void * p,
... )
related

Create a memory list.

If p is NULL or allocation fails, it will return NULL. It always stops at first NULL element.

◆ freeml()

void freeml ( struct memory_list * ml)
related

Free elements and memory list.

It returns safely if passed a NULL pointer.

Field Documentation

◆ n

int memory_list::n

◆ p

void* memory_list::p[1]

The documentation for this struct was generated from the following files: