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

DataAllocator.cpp File Reference

#include "base/DataAllocator.h"
#include "io/FileStreamBuffer.h"
#include "debug/macros.h"
#include "debug/new.h"

Namespaces

namespace  base

Defines

#define DEBUG_OFFSET   1
#define CHECK_ALIGNED32(PTR)

Functions

static void DataAllocator_printMem (std::ostream &out, const char *caption, uint32_t mem)
 Utility function to print stats.
int32_t * base_allocate (size_t size, void *allocator)
 C wrapper function for DataAllocator.
void base_deallocate (void *mem, size_t intSize, void *allocator)
 C wrapper function for DataAllocator.
int32_t * base_new (std::size_t size, void *)
void base_delete (void *mem, size_t unused1, void *unused2)
 C wrapper function for delete.

Variables

allocator_t base_newallocator
 C wrapper allocator instance for new.

Define Documentation

#define CHECK_ALIGNED32 PTR   ) 
 

Value:

ASSERT((((uintptr_t)(PTR)) & 3) == 0,\
               std::cerr << "Allocated memory is not 32 bits aligned.\n")

#define DEBUG_OFFSET   1
 


Function Documentation

int32_t* base_allocate size_t  size,
void *  allocator
 

C wrapper function for DataAllocator.

See also:
dbm/mingraph.h
Parameters:
size,: size in int to allocate.
allocator,: a pointer to DataAllocator

void base_deallocate void *  mem,
size_t  intSize,
void *  allocator
 

C wrapper function for DataAllocator.

See also:
base/c_allocator.h
Parameters:
mem,: memory to deallocate
intSize,: size in int to deallocate
allocator,: DataAllocator object
Precondition:
memory was allocated with base_allocate and intSize corresponds to the allocated size.

void base_delete void *  mem,
size_t  unused1,
void *  unused2
 

C wrapper function for delete.

See also:
base/c_allocator.h
Parameters:
mem,: memory to deallocate.
unused1,unused2,: unused parameters.

int32_t* base_new std::size_t  size,
void * 
 

static void base::DataAllocator_printMem std::ostream &  out,
const char *  caption,
uint32_t  mem
[static]
 

Utility function to print stats.


Variable Documentation

allocator_t base_newallocator
 

Initial value:

{
    allocData:NULL,
    allocFunction:base_new,
    deallocFunction:base_delete
}
C wrapper allocator instance for new.


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