OMMemoryManager class

OMMemoryManager is the default memory manager for the framework. It is part of the mechanism that enables you to use custom memory managers.

The OXF had built-in memory control support for the following elements:

Base class

OMAbstractMemoryAllocator

Construction summary
OMMemoryManager
Constructs an OMMemoryManager object
~OMMemoryManager
Destroys the OMMemoryManager object
Macro and operator summary
OM_DECLARE_FRAMEWORK_
MEMORY_ALLOCATION_
OPERATORS
Defines the memory allocation operators
OMDELETE
Deletes the specified memory using either the memory manager or the global delete operator (when the framework and application are compiled with OM_NO_FRAMEWORK_MEMORY_MANAGER)
OMGET_MEMORY
Allocates memory using either the memory manager or the global new operator (when the framework and application are compiled with OM_NO_FRAMEWORK_MEMORY_MANAGER)
OMNEW
Allocates memory using either the memory manager or the global new operator (when the framework and application are compiled with OM_NO_FRAMEWORK_MEMORY_MANAGER)
Method summary
getDefaultMemoryManager
Returns the default memory manager
getMemory
Records the memory allocated by the default manager
getMemoryManager
Returns the current memory manager
returnMemory
Returns the memory from an instance
Operators and macros

OM_DECLARE_FRAMEWORK_MEMORY_ALLOCATION_OPERATORS

The macros and operators support user control over memory allocation. The new parameter NEW_DUMMY_PARAM is set to "size_t=0" for every compiler.

The updated definition is as follows:

define OM_DECLARE_FRAMEWORK_MEMORY_ALLOCATION_OPERATORS

public:
    static void* operator new (size_t size
        NEW_DUMMY_PARAM)
    static void* operator new[] (size_t size
        NEW_DUMMY_PARAM
    static void operator delete (void * object,
        size_t size)
    static void operator delete[] (void * object, 
        size_t size) 

OMGET_MEMORY

Allocates memory using either the memory manager or the global new operator (when the framework and application are compiled with OM_NO_FRAMEWORK_MEMORY_MANAGER).

It is defined as follows:

#define OMGET_MEMORY(size)

OMNEW

Allocates memory using either the memory manager or the global new operator (when the framework and application are compiled with OM_NO_FRAMEWORK_MEMORY_MANAGER).

It is defined as follows:

#define OMNEW(type, size)

OMDELETE

Deletes the specified memory using either the memory manager or the global delete operator (when the framework and application are compiled with the OM_NO_FRAMEWORK_MEMORY_MANAGER switch).

It is defined as follows:

#define OMDELETE(object,size)

Feedback