oaMemory Class Reference


Static Public Methods

void * get (size_t size)
void * resize (void *ptr, size_t size)
void free (void *ptr)

Detailed Description

The oaMemory class is a utility class that encapsulates and adds error checking to the memory management functions, including: malloc, realloc, and free. Using these allocation routines instead of new or delete is more efficient on some platforms.


Member Function Documentation

void oaMemory::free void *    ptr [static]
 

This function makes memory previously allocated by the get() or resize() functions available for further allocation.

void * oaMemory::get size_t    size [static]
 

This function gets a block of memory of the specified size in bytes and returns a pointer to it. The allocation is made by making a call to malloc( ).

Exceptions:
oacMemGetFailed 

void * oaMemory::resize void *    ptr,
size_t    size
[static]
 

This function resizes a block of memory specified by ptr to the specified size in bytes and returns a pointer to the new block of memory. The memory is resized by making a call to realloc( ). The contents of the existing memory are unchanged. Specifying size as zero frees the memory.

Exceptions:
oacMemResizeFailed 


The documentation for this class was generated from the following files:

Return to top of page