NAME
asn1_malloc
asn1_realloc
asn1_free
asn1_alloc_snap_shot
SYNOPSIS
#include "asn1.h"
char * asn1_malloc(len)
unsigned len;
char * asn1_realloc(area,len)
char * area;
unsigned len;
void asn1_free(area)
char * area;
int asn1_alloc_snap_shot(add)
char *** add;
DESCRIPTION
MAVROS use its own set of memory allocation routines:
-
asn1_malloc
will be called instead of
malloc
by the decoding routines,
-
asn1_realloc
will be called instead of
realloc,
-
asn1_free
will be called instead of
free.
These routine maintain a list of allocated pointers, which is accessed
through a hashing table maintained by static procedures.
Asn1_free
will take no action if the pointer to be freed is not present in the
hashed list, i.e. was not allocated by
asn1_malloc
or was
already freed by
asn1_free;
it will call
free
and remove the pointer from the list otherwise.
The routine
asn1_alloc_snap_shot
can be used to get the number of blocs which are represented in the
hashing table at a given time.
It can be used when debugging complex applications,
e.g. to check that a server is not silently crunching all the available
memory... If the pointer
add
is non null,
asn1_alloc_snap_shot
will fill it with a pointer to the list of addresses currently referenced
in the hashed table. That area which holds that list is allocated by means of
malloc
and should indeed be freed in due time.
"SEE ALSO"
malloc (3),
mavcod (9x),
mavros (9x),
mavros-input (9x),
mavros-output (9x),
asn1_oid(9x),
asn1_time(9x),
asn1_malloc(9x)
C. Huitema,
"General Presentation of the MAVROS Compiler" ,INRIA, 1990