allocator
[utilities]


Classes

struct  axutil_allocator
 Axis2 memory allocator. More...

Defines

#define AXIS2_MALLOC(allocator, size)   ((allocator)->malloc_fn(allocator, size))
#define AXIS2_REALLOC(allocator, ptr, size)   ((allocator)->realloc(allocator, ptr, size))
#define AXIS2_FREE(allocator, ptr)   ((allocator)->free_fn(allocator, ptr))

Typedefs

typedef axutil_allocator axutil_allocator_t
 Axis2 memory allocator.

Functions

AXIS2_EXTERN axutil_allocator_taxutil_allocator_init (axutil_allocator_t *allocator)
AXIS2_EXTERN void axutil_allocator_free (axutil_allocator_t *allocator)
AXIS2_EXTERN void axutil_allocator_switch_to_global_pool (axutil_allocator_t *allocator)
AXIS2_EXTERN void axutil_allocator_switch_to_local_pool (axutil_allocator_t *allocator)

Typedef Documentation

typedef struct axutil_allocator axutil_allocator_t
 

Axis2 memory allocator.

Encapsulator for memory allocating routines


Function Documentation

AXIS2_EXTERN void axutil_allocator_free axutil_allocator_t allocator  ) 
 

This function should be used to deallocate memory if the default allocator provided by axutil_allocator_init()

Parameters:
allocator 

AXIS2_EXTERN axutil_allocator_t* axutil_allocator_init axutil_allocator_t allocator  ) 
 

Initializes (creates) an allocator.

Parameters:
allocator user defined allcator. Optional, can be NULL. If NULL, a default allocator will be returned.
Returns:
initialized allocator. NULL on error.

AXIS2_EXTERN void axutil_allocator_switch_to_global_pool axutil_allocator_t allocator  ) 
 

Swaps the local_pool and global_pool values. In case of using pools, local_pool is suppoed to hold the pool out of which local values are allocated. In case of values that live beyond a request globle pool should be used, hence this method has to be called to swithch to globle pool for allocation.

Parameters:
allocator allocator whose memory pools are to be switched

AXIS2_EXTERN void axutil_allocator_switch_to_local_pool axutil_allocator_t allocator  ) 
 

Swaps the local_pool and global_pool values. In case of using pools, local_pool is suppoed to hold the pool out of which local values are allocated. In case of values that live beyond a request globle pool should be used. This method can be used to inverse the switching done by axutil_allocator_switch_to_global_pool, to start using the local pool again.

Parameters:
allocator allocator whose memory pools are to be switched


Generated on Thu May 3 12:31:03 2007 for Axis2/C by  doxygen 1.4.6