FastObj Class Reference

List of all members.

Detailed Description

Fast object with global pool.

The FastObj class uses global pool. So, the FastObj class may be used with polymorphic classes in contrast to FastObjT class. Any allocation/deallocation operations use mem_get_sized() and mem_put_sized() functions.

To use fast memory management your class should be derived from the FastObj class. See the example below.

    class MyClass: public omni::pool::FastObj {
      // ...
    };

    class Test: public MyClass {
      // ...
    };

    void f()
    {
      MyClass *p1 = new MyClass(); // mem_get_sized() used
      // ...
      delete p1; // mem_put_sized() used

      Test *p2 = new Test(); // mem_get_sized() used
      // ...
      delete p2; // mem_put_sized() used
    }

See also:
Fast memory management.

Static Public Member Functions

Protected Member Functions


Constructor & Destructor Documentation

FastObj (  )  [protected]

Trivial constructor.

~FastObj (  )  [protected, virtual]

Trivial virtual destructor.


Member Function Documentation

void * operator new ( size_t  buf_size  )  [static]

The memory allocation.

This operator allocates the buf_size bytes memory block using mem_get_sized() function.

Exceptions:
std::bad_alloc If no memory is available.
Parameters:
[in] buf_size The memory block size.
Returns:
The memory block.

void * operator new ( size_t  buf_size,
const std::nothrow_t &   
) [static]

The memory allocation.

This operator allocates the buf_size bytes memory block using mem_get_sized() function.

If there is no available memory, then this operator will return null pointer.

Parameters:
[in] buf_size The memory block size.
Returns:
The memory block or null.

void * operator new ( size_t  buf_size,
void *  p 
) [static]

Placement new operator.

This operator is used only for correct overloading of other new operators. It uses global placement new operator.

Parameters:
[in] buf_size The memory block size.
[in] p The memory block.
Returns:
The memory block.

void operator delete ( void *  buf  )  [static]

The memory deallocation.

This operator deallocates the buf memory block using mem_put_sized() function.

Parameters:
[in] buf The memory block.

void operator delete ( void *  buf,
const std::nothrow_t &   
) [static]

The memory deallocation.

This operator deallocates the buf memory block using mem_put_sized() function.

Parameters:
[in] buf The memory block.

void operator delete ( void *  buf,
void *  p 
) [static]

Placement delete operator?

This operator is used only for correct overloading of other delete operators. It uses global placement delete operator.

Parameters:
[in] buf The memory block?
[in] p The memory block?


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