Home Download Musics Developers
API Sources Tools File Format Technicals

Dynamic memory buffers
[file68 library documentation.]


Detailed Description

Provides dynamic memory management functions.


Files

file  alloc68.h
 dynamic memory header.


Typedefs

typedef void *(* sc68_alloc_t )(unsigned int)
 Alloc function (malloc).

typedef void(* sc68_free_t )(void *)
 Free function (free).


Functions

void * SC68alloc (unsigned int n)
 Allocate dynamic memory.

void * SC68calloc (unsigned int n)
 Allocate and clean dynamic memory.

void SC68free (void *data)
 Free dynamic memory.

sc68_alloc_t SC68set_alloc (sc68_alloc_t alloc)
 Set/get dynamic memory allocation handler.

sc68_free_t SC68set_free (sc68_free_t free)
 Set/get dynamic memory free handler.


Function Documentation

void* SC68alloc unsigned int  n  ) 
 

Allocate dynamic memory.

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

Parameters:
n Size of buffer to allocate.
Returns:
pointer to allocated memory buffer.
Return values:
0 error
See also:
SC68set_alloc()

SC68calloc()

SC68free()

void* SC68calloc unsigned int  n  ) 
 

Allocate and clean dynamic memory.

The SC68calloc() function calls user defined dynamic memory allocation handler and fills memory buffer with 0.

Parameters:
n Size of buffer to allocate.
Returns:
pointer to allocated memory buffer.
Return values:
0 error
See also:
SC68set_alloc()

SC68alloc()

SC68free()

void SC68free void *  data  ) 
 

Free dynamic memory.

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

Parameters:
data Previously allocated memory buffer.
Returns:
pointer to allocated memory
Return values:
0 Failure.
See also:
SC68set_free()

SC68alloc()

sc68_alloc_t SC68set_alloc sc68_alloc_t  alloc  ) 
 

Set/get dynamic memory allocation handler.

Parameters:
alloc Set 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:
free Set new free handler (0:get old value).
Returns:
previous free handler.
See also:
SC68free()