Main Page | Class List | File List | Class Members | File Members

ipod_memory.h File Reference

Memory allocation functions. More...

#include <stdlib.h>

Go to the source code of this file.

Typedefs

typedef void *(* ipod_memory_alloc_func )(size_t size, void *userData)
 Callback to allocate memory.
typedef void *(* ipod_memory_realloc_func )(void *p, size_t size, void *userData)
 Callback to reallocate memory.
typedef void(* ipod_memory_free_func )(void *p, void *userData)
 Callback to free memory.

Functions

void ipod_memory_set_funcs (ipod_memory_alloc_func alloc_func, ipod_memory_realloc_func realloc_func, ipod_memory_free_func free_func, void *userData)
 Set the memory callback functions.
void * ipod_memory_alloc (size_t size)
 Allocate memory.
void * ipod_memory_realloc (void *p, size_t size)
 Reallocate memory.
void ipod_memory_free (void *p)
 Free memory.
void ipod_memory_report (void)
 Print out some internal statistics.


Detailed Description

Memory allocation functions.


Typedef Documentation

typedef void*(* ipod_memory_alloc_func)(size_t size, void *userData)
 

Callback to allocate memory.

Parameters:
size the number of bytes to allocate
userData implementation-specific data
Returns:
a pointer to the allocated bytes

typedef void(* ipod_memory_free_func)(void *p, void *userData)
 

Callback to free memory.

Parameters:
p the block of memory to free
userData implementation-specific data

typedef void*(* ipod_memory_realloc_func)(void *p, size_t size, void *userData)
 

Callback to reallocate memory.

Parameters:
p the block of memory to be reallocated
size the number of bytes to allocate
userData implementation-specific data
Returns:
a pointer to the reallocated bytes


Function Documentation

void* ipod_memory_alloc size_t  size  ) 
 

Allocate memory.

Parameters:
size the number of bytes to allocate
Returns:
a pointer to the allocated bytes

void ipod_memory_free void *  p  ) 
 

Free memory.

Parameters:
p the block of memory to free

void* ipod_memory_realloc void *  p,
size_t  size
 

Reallocate memory.

Parameters:
p the block of memory to be reallocated
size the number of bytes to allocate
Returns:
a pointer to the reallocated bytes

void ipod_memory_set_funcs ipod_memory_alloc_func  alloc_func,
ipod_memory_realloc_func  realloc_func,
ipod_memory_free_func  free_func,
void *  userData
 

Set the memory callback functions.

Parameters:
alloc_func callback to allocate memory
realloc_func callback to reallocate memory
free_func callback to free memory
userData implementation-specific data sent to the callbacks


Generated on Tue Dec 13 14:55:22 2005 for libipod by  doxygen 1.3.9.1