sc68fordevelopers  2.2.1
Typedefs | Functions
alloc68.h File Reference

memory allocation handler. More...

Go to the source code of this file.

Typedefs

typedef void *(* sc68_alloc_t) (unsigned int)
 Alloc function (malloc). More...
 
typedef void(* sc68_free_t) (void *)
 Free function (free). More...
 

Functions

void * SC68alloc (unsigned int n)
 Allocate dynamic memory. More...
 
void SC68free (void *data)
 Free dynamic memory. More...
 
sc68_alloc_t SC68set_alloc (sc68_alloc_t alloc)
 Set/get dynamic memory allocation handler. More...
 
sc68_free_t SC68set_free (sc68_free_t free)
 Set/get dynamic memory free handler. More...
 

Detailed Description

memory allocation handler.

Author
Benjamin Gerard
Date
2003/04/11
Id
alloc68.h,v 2.3 2003/08/30 01:27:08 benjihan Exp

SC68 memory allocation handler module provides function to allocate and free memory buffer.

Typedef Documentation

typedef void*(* sc68_alloc_t) (unsigned int)

Alloc function (malloc).

typedef void(* sc68_free_t) (void *)

Free function (free).

Function Documentation

void* SC68alloc ( unsigned int  n)

Allocate dynamic memory.

The SC68alloc() function calls user defined dynamic memory allocation handler.

Parameters
nSize of buffer to allocate.
Returns
pointer to allocated memory buffer.
Return values
0error
See also
SC68set_alloc()
SC68free()
void SC68free ( void *  data)

Free dynamic memory.

The SC68free() function calls user defined dynamic memory free handler.

Parameters
dataPreviously allocated memory buffer.
Returns
pointer to allocated memory
Return values
0Failure.
See also
SC68set_free()
SC68alloc()
sc68_alloc_t SC68set_alloc ( sc68_alloc_t  alloc)

Set/get dynamic memory allocation handler.

Parameters
allocSet new alloc handler (0:get old value).
Returns
previous alloc handler.
See also
SC68alloc()
sc68_free_t SC68set_free ( sc68_free_t  free)

Set/get dynamic memory free handler.

Parameters
freeSet new free handler (0:get old value).
Returns
previous free handler.
See also
SC68free()