Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

c_allocator.h File Reference

Implementation of a particular allocator_t to check for memory leaks when testing. More...

#include "base/c_allocator.h"
#include "base/intutils.h"

Go to the source code of this file.

Typedefs

typedef debug_allocation_s debug_allocation_t
 Type to keep track of allocations.

Enumerations

enum  { debug_ALLOCATION_TABLE = 1 << 20 }
 Size of the allocation table. More...

Functions

int32_t * debug_malloc (size_t intSize, void *debugAllocations)
 Debug allocator function based on malloc.
void debug_free (void *ptr, size_t intSize, void *debugAllocations)
 Debug free function, to free memory allocated by debug_malloc.
static void debug_initAllocator (allocator_t *alloc)
 Initialize a debug_allocator_t.
void debug_destroyAllocator (allocator_t *debugAllocator)
 Destroy a debug allocator and check it for leaks.


Detailed Description

Implementation of a particular allocator_t to check for memory leaks when testing.


Typedef Documentation

typedef struct debug_allocation_s debug_allocation_t
 

Type to keep track of allocations.


Enumeration Type Documentation

anonymous enum
 

Size of the allocation table.

This MUST be a power of 2.

Enumeration values:
debug_ALLOCATION_TABLE 


Function Documentation

void debug_destroyAllocator allocator_t debugAllocator  ) 
 

Destroy a debug allocator and check it for leaks.

Parameters:
debugAllocator,: an allocator as initialized by debug_initAllocator

void debug_free void *  ptr,
size_t  intSize,
void *  debugAllocations
 

Debug free function, to free memory allocated by debug_malloc.

Parameters:
ptr,: memory to deallocate.
intSize,: size to deallocate
debugAllocations,: all the allocations.

static void debug_initAllocator allocator_t alloc  )  [inline, static]
 

Initialize a debug_allocator_t.

Parameters:
alloc,: allocator to initialize.

int32_t* debug_malloc size_t  intSize,
void *  debugAllocations
 

Debug allocator function based on malloc.

Parameters:
intSize,: size to allocate in ints
debugAllocations,: a debug_allocation_t**
Returns:
int32_t[intSize] allocated by malloc


Generated on Fri Jun 30 00:02:51 2006 for Module debug by  doxygen 1.4.2