omni::pool Namespace Reference


Detailed Description

Fast memory manager.

This namespace contains fast memory manager tools.

See also:
Fast memory management.

Classes

Namespaces

Functions


Function Documentation

void * mem_get ( size_t  buf_size  ) 

Allocate the memory block.

This function allocates the memory block of buf_size bytes. If the memory block size is less than or equal to 4 Kbytes, then global pool manager will be used, otherwise new operator will be used.

To release allocated memory block you should call mem_put() function and provide the same memory block size!

In debug version the whole memory block is filled by 0xAA value.

Parameters:
[in] buf_size The memory block size in bytes.
Returns:
The allocated memory block.
See also:
mem_put()

mem_get_sized()

void mem_put ( void *  buf,
size_t  buf_size 
)

Release the memory block.

This function releases the memory block buf of buf_size bytes. If the memory block size is less than or equal to 4 Kbytes, then global pool manager will be used, otherwise delete operator will be used.

The memory block size buf_size should be the same as when calling mem_get()!

In debug version the whole memory block is filled by 0xAA value.

Parameters:
[in] buf The memory block.
[in] buf_size The memory block size in bytes.
See also:
mem_get()

void * mem_get_sized ( size_t  buf_size  ) 

Allocate the memory block.

This function allocates the memory block of buf_size bytes. If the memory block size is less than or equal to 4 Kbytes, then global pool manager will be used, otherwise new operator will be used.

To release allocated memory block you should call mem_put_sized() function!

In debug version the whole memory block is filled by 0xAA value.

Parameters:
[in] buf_size The memory block size in bytes.
Returns:
The allocated memory block.
See also:
mem_put_sized()

mem_get()

void mem_put_sized ( void *  buf  ) 

Release the memory block.

This function releases the memory block buf. If the memory block size is less than or equal to 4 Kbytes, then global pool manager will be used, otherwise delete operator will be used.

In debug version the whole memory block is filled by 0xAA value.

Parameters:
[in] buf The memory block.
See also:
mem_get_sized()

bool omni::pool::operator== ( const Allocator< T > &  ,
const Allocator< U > &   
) [inline]

Are two allocators equal?

The two allocators are always equal.

Returns:
true.

bool omni::pool::operator!= ( const Allocator< T > &  ,
const Allocator< U > &   
) [inline]

Are two allocators non-equal?

The two allocators are always equal.

Returns:
false.


Generated on Wed Jun 6 17:27:47 2007 for OMNI by  doxygen 1.5.2