Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ObjectAllocator.h"
- // initialization of static variable
- const int ObjectAllocator::FLAGS_SIZE = 1;
- const int ObjectAllocator::ALLOCATION_SIZE = 4;
- const int ObjectAllocator::USE_COUNTER_SIZE = 2;
- /******************************************************************************/
- /*!
- \brief
- Constructor for ObjectAllocator class
- \param ObjectSize
- Size of each object
- \param config
- Configuration of the object allocator
- */
- /******************************************************************************/
- ObjectAllocator::ObjectAllocator(size_t ObjectSize, const OAConfig& config)
- throw(OAException) :
- _blockSize(0), _pageHeadSize(0), _ptrSize(sizeof(void*)),
- _hasInternalHeader(false), _hasAlignment(false)
- {
- // initialize the OA base on the config
- InitHeaderConfig(config);
- _config = config;
- _stats.ObjectSize_ = ObjectSize;
- _blockSize = static_cast<unsigned>(ObjectSize) +
- 2 * config.PadBytes_ + _headerSize;
- _pageHeadSize = _ptrSize + _headerSize + config.PadBytes_;
- _stats.PageSize_ = _ptrSize + (config.ObjectsPerPage_ * _blockSize);
- // calculate the alignment based on the config
- CalculateAlignment(config);
- // create an initial page for the OA
- try
- {
- _pageList = CreatePage();
- reinterpret_cast<GenericObject*>(_pageList)->Next = 0;
- }
- catch (std::bad_alloc&)
- {
- throw OAException(OAException::E_NO_MEMORY, "The system is out of memory.");
- }
- }
- /******************************************************************************/
- /*!
- \brief
- Init the header configuration based on the input config
- \param config
- Configuration of the object allocator
- */
- /******************************************************************************/
- void ObjectAllocator::InitHeaderConfig(const OAConfig& config)
- {
- // Initializae header size and whether if internal header exists
- switch (config.HBlockInfo_.type_)
- {
- case OAConfig::hbBasic:
- _headerSize = config.BASIC_HEADER_SIZE;
- _hasInternalHeader = true;
- break;
- case OAConfig::hbExtended:
- _headerSize = static_cast<unsigned>(config.HBlockInfo_.size_);
- _hasInternalHeader = true;
- break;
- case OAConfig::hbExternal:
- _headerSize = config.EXTERNAL_HEADER_SIZE;
- _hasInternalHeader = false;
- break;
- default:
- _headerSize = 0;
- _hasInternalHeader = false;
- break;
- }
- }
- /******************************************************************************/
- /*!
- \brief
- Calculate the alignment
- \param config
- Configuration of the object allocator
- */
- /******************************************************************************/
- void ObjectAllocator::CalculateAlignment(const OAConfig& config)
- {
- // do not check if alignment is 1
- if (config.Alignment_ <= 1)
- return;
- // compute left alignment
- if (config.Alignment_ >= _pageHeadSize)
- _config.LeftAlignSize_ = config.Alignment_ - _pageHeadSize;
- else
- {
- unsigned tmp = config.Alignment_;
- while (tmp < _pageHeadSize)
- tmp += config.Alignment_;
- _config.LeftAlignSize_ = tmp - _pageHeadSize;
- }
- _pageHeadSize += _config.LeftAlignSize_;
- // compute inter alignment
- if (config.Alignment_ >= _blockSize)
- _config.InterAlignSize_ = config.Alignment_ % _blockSize;
- else
- {
- unsigned tmp = config.Alignment_;
- while (tmp < _blockSize)
- tmp += config.Alignment_;
- _config.InterAlignSize_ = tmp - _blockSize;
- }
- _blockSize += _config.InterAlignSize_;
- // compute the new size of each page
- _stats.PageSize_ = _ptrSize + _config.LeftAlignSize_ +
- config.ObjectsPerPage_ * _blockSize - _config.InterAlignSize_;
- _hasAlignment = true;
- }
- /******************************************************************************/
- /*!
- \brief
- Allocate memory for a page
- */
- /******************************************************************************/
- char* ObjectAllocator::CreatePage()
- {
- // allocate memory on the freestore
- char* page = new char[_stats.PageSize_];
- // memset pattern of unallocated
- std::memset(page, UNALLOCATED_PATTERN, _stats.PageSize_);
- reinterpret_cast<GenericObject*>(page)->Next = 0;
- // if left alignment exists, memset alignment pattern
- if (_hasAlignment)
- {
- char* LeftAlignPtr = page + _ptrSize;
- std::memset(LeftAlignPtr, ALIGN_PATTERN, _config.LeftAlignSize_);
- }
- _freeList = page + _pageHeadSize;
- reinterpret_cast<GenericObject*>(_freeList)->Next = NULL;
- // memset pattern of padding
- std::memset(_freeList - _config.PadBytes_, PAD_PATTERN, _config.PadBytes_);
- std::memset(_freeList - _config.PadBytes_ - _headerSize, 0, _headerSize);
- // initialize each block in the page for usage
- InitBlock();
- // memset pattern of padding of back
- std::memset(_freeList + _stats.ObjectSize_, PAD_PATTERN, _config.PadBytes_);
- _stats.FreeObjects_ += _config.ObjectsPerPage_;
- ++_stats.PagesInUse_;
- return page;
- }
- /******************************************************************************/
- /*!
- \brief
- Initialize the block on the page
- */
- /******************************************************************************/
- void ObjectAllocator::InitBlock()
- {
- for (unsigned i = 0; i < _config.ObjectsPerPage_ - 1; ++i)
- {
- char* tmp = _freeList; // keep a temp for linkage
- // memset pattern of padding
- std::memset(_freeList + _stats.ObjectSize_, PAD_PATTERN, _config.PadBytes_);
- // memset pattern of inter alignment if exists
- if (_hasAlignment)
- std::memset(_freeList + _stats.ObjectSize_ + _config.PadBytes_,
- ALIGN_PATTERN, _config.InterAlignSize_);
- _freeList += _blockSize;
- // memset pattern for padding
- std::memset(_freeList - _config.PadBytes_, PAD_PATTERN, _config.PadBytes_);
- // memset pattern for header
- std::memset(_freeList - _config.PadBytes_ - _headerSize, 0, _headerSize);
- // handle linkage to the previous freeList
- reinterpret_cast<GenericObject*>(_freeList)->Next =
- reinterpret_cast<GenericObject*>(tmp);
- }
- }
- /******************************************************************************/
- /*!
- \brief
- Destructor for ObjectAllocator class
- */
- /******************************************************************************/
- ObjectAllocator::~ObjectAllocator() throw()
- {
- // loop through all the pages and free all the header that was allocated
- while (_pageList)
- {
- char * nextPage =
- reinterpret_cast<char *>(reinterpret_cast<GenericObject*>(_pageList)->Next);
- RemovePageHeader();
- RemoveInterblockHeader();
- delete [] _pageList;
- _pageList = nextPage; // move to next page
- }
- }
- /******************************************************************************/
- /*!
- \brief
- Constructor for ObjectAllocator class
- \param label
- Label for the header block
- */
- /******************************************************************************/
- void * ObjectAllocator::Allocate(const char *label) throw(OAException)
- {
- if (_config.UseCPPMemManager_)
- return CPPNew();
- // check if any more objects can be allocated
- CheckMaxObjects();
- char * freeBlock = _freeList;
- ++_stats.Allocations_;
- // check if the current page is full
- CheckFullPage(&freeBlock);
- // init block header
- if (_hasInternalHeader)
- InitInternalHeader();
- else if (_config.HBlockInfo_.type_ == OAConfig::hbExternal)
- InitExternalHeader(label);
- _freeList =
- reinterpret_cast<char *>(reinterpret_cast<GenericObject *>(_freeList)->Next);
- // memset pattern for allocated
- std::memset(freeBlock, ALLOCATED_PATTERN, _stats.ObjectSize_);
- // modify stats
- ++_stats.ObjectsInUse_;
- ++_stats.MostObjects_;
- --_stats.FreeObjects_;
- return freeBlock;
- }
- /******************************************************************************/
- /*!
- \brief
- Allocate block using C++ lib new
- */
- /******************************************************************************/
- void * ObjectAllocator::CPPNew() throw (OAException)
- {
- try
- {
- char * newBlock = new char[_stats.ObjectSize_];
- ++_stats.Allocations_;
- ++_stats.MostObjects_;
- --_stats.FreeObjects_;
- return newBlock;
- }
- catch (std::bad_alloc&)
- {
- throw OAException(OAException::E_NO_MEMORY, "The system is out of memory.");
- }
- }
- /******************************************************************************/
- /*!
- \brief
- Check if the OA has reached its maximum cap
- */
- /******************************************************************************/
- void ObjectAllocator::CheckMaxObjects() throw (OAException)
- {
- if (!_config.MaxPages_)
- return;
- // check if any more objects can be allocated
- if (_stats.ObjectsInUse_ >= _config.MaxPages_ * _config.ObjectsPerPage_)
- throw OAException(OAException::E_NO_PAGES, "Reached max objects.");
- }
- /******************************************************************************/
- /*!
- \brief
- Check if the page is full
- \param block
- Pointer to the last block of the page
- */
- /******************************************************************************/
- void ObjectAllocator::CheckFullPage(char ** block) throw (OAException)
- {
- if (*block) // if block != null, page not full
- return;
- // try to allocate memory for a new page
- try
- {
- *block = CreatePage();
- reinterpret_cast<GenericObject *>(*block)->Next =
- reinterpret_cast<GenericObject *>(_pageList);
- _pageList = reinterpret_cast<char *>(*block);
- }
- catch (std::bad_alloc&)
- {
- throw OAException(OAException::E_NO_MEMORY, "The system is out of memory.");
- }
- *block = _freeList;
- }
- /******************************************************************************/
- /*!
- \brief
- Initialize the internal header of the page
- */
- /******************************************************************************/
- void ObjectAllocator::InitInternalHeader()
- {
- // pointer to the header
- char * header = _freeList - _config.PadBytes_ - _headerSize;
- // init header base on config
- if (_config.HBlockInfo_.type_ == OAConfig::hbBasic)
- {
- *(header + ALLOCATION_SIZE) = 1;
- *reinterpret_cast<unsigned *>(header) = _stats.Allocations_;
- }
- else if (_config.HBlockInfo_.type_ == OAConfig::hbExtended)
- {
- ++*(header + _headerSize - FLAGS_SIZE -
- ALLOCATION_SIZE - USE_COUNTER_SIZE);
- *(header + _headerSize - FLAGS_SIZE) = 1;
- *reinterpret_cast<unsigned *>(
- header + _headerSize - FLAGS_SIZE - ALLOCATION_SIZE) = _stats.Allocations_;
- }
- }
- /******************************************************************************/
- /*!
- \brief
- Initialize the external header of the page
- \param label
- Label used to initialize the external header with
- */
- /******************************************************************************/
- void ObjectAllocator::InitExternalHeader(const char * label) throw(OAException)
- {
- // create header info for block
- char* header;
- try
- {
- header = new char[sizeof(MemBlockInfo)];
- }
- catch (std::bad_alloc&)
- {
- throw OAException(OAException::E_NO_MEMORY, "The system is out of memory.");
- }
- reinterpret_cast<MemBlockInfo*>(header)->in_use = true;
- reinterpret_cast<MemBlockInfo*>(header)->alloc_num = _stats.Allocations_;
- // allocate memory for label if needed
- if (label)
- {
- reinterpret_cast<MemBlockInfo*>(header)->label= new char[strlen(label) + 1];
- strcpy(reinterpret_cast<MemBlockInfo*>(header)->label, label);
- }
- else
- reinterpret_cast<MemBlockInfo*>(header)->label = 0;
- // set header info to block's header
- *(reinterpret_cast<MemBlockInfo**>(_freeList-_config.PadBytes_-_headerSize)) =
- reinterpret_cast<MemBlockInfo *>(header);
- }
- /******************************************************************************/
- /*!
- \brief
- Free the object
- \param Object
- Pointer to the block to be freed
- */
- /******************************************************************************/
- void ObjectAllocator::Free(void * Object) throw(OAException)
- {
- if (!Object)
- return;
- if (_config.UseCPPMemManager_)
- {
- CPPDelete(Object);
- return;
- }
- // an exception will be thrown if object not valid
- if (_config.DebugOn_)
- ValidateFree(Object);
- if (_hasInternalHeader)
- RemoveInternalHeader(Object);
- else if (_config.HBlockInfo_.type_ == OAConfig::hbExternal)
- RemoveExternalHeader(Object);
- }
- /******************************************************************************/
- /*!
- \brief
- Check if the free call is valid
- \param Object
- Pointer to the block to be freed
- */
- /******************************************************************************/
- void ObjectAllocator::ValidateFree(void * Object) throw(OAException)
- {
- // validate free by checking boundary and multiple freeing
- CheckBadBoundary(Object);
- CheckMultipleFree(Object);
- if (_config.PadBytes_)
- CheckCorruptedBlock(Object);
- // remove headers
- if (_hasInternalHeader)
- RemoveInternalHeader(Object);
- else if (_config.HBlockInfo_.type_ == OAConfig::hbExternal)
- RemoveExternalHeader(Object);
- // memset pattern for freed
- std::memset(Object, FREED_PATTERN, _stats.ObjectSize_);
- // relink the freelist pointer
- GenericObject * tmp = reinterpret_cast<GenericObject*>(_freeList);
- _freeList = reinterpret_cast<char *>(Object);
- reinterpret_cast<GenericObject *>(_freeList)->Next = tmp;
- ++_stats.Deallocations_;
- ++_stats.FreeObjects_;
- --_stats.ObjectsInUse_;
- }
- /******************************************************************************/
- /*!
- \brief
- Check if the location to be freed is in bad bounds
- \param Object
- Pointer to the block to be freed
- */
- /******************************************************************************/
- void ObjectAllocator::CheckBadBoundary(void * Object) throw(OAException)
- {
- char * currPage = _pageList;
- while (currPage)
- {
- char * pageStart = currPage + _pageHeadSize;
- unsigned pageAdd = reinterpret_cast<unsigned>(currPage);
- unsigned objAdd = reinterpret_cast<unsigned>(Object);
- // check if object is within the page
- if (objAdd - pageAdd < _stats.PageSize_)
- {
- unsigned offset = reinterpret_cast<char *>(Object) - pageStart;
- // check if the object is aligned
- if (!(offset % _blockSize))
- return;
- }
- currPage = reinterpret_cast<char *>(
- reinterpret_cast<GenericObject *>(currPage)->Next);
- }
- // throw an exception if reaches to this point, meaning it is not aligned
- throw OAException(OAException::E_BAD_BOUNDARY,
- "Trying to free an object in a bad boundary.");
- }
- /******************************************************************************/
- /*!
- \brief
- Check if the current location has been freed
- \param Object
- Pointer to the block to be freed
- */
- /******************************************************************************/
- void ObjectAllocator::CheckMultipleFree(void * Object) throw(OAException)
- {
- GenericObject * tmp = reinterpret_cast<GenericObject *>(_freeList);
- // check if object that we are freeing is already in the free list
- while (tmp)
- {
- if (Object == tmp)
- throw OAException(OAException::E_MULTIPLE_FREE,
- "Trying to free an object multiple times.");
- tmp = tmp->Next;
- }
- }
- /******************************************************************************/
- /*!
- \brief
- Check if the location to be freed is corrupted
- \param Object
- Pointer to the block to be freed
- */
- /******************************************************************************/
- void ObjectAllocator::CheckCorruptedBlock(void * Object) throw(OAException)
- {
- unsigned char * tmp = reinterpret_cast<unsigned char *>(Object);
- // loop through and check if padding are corrupted block
- for (unsigned i = 0; i < _config.PadBytes_; i++)
- {
- if (*(tmp - _config.PadBytes_ + i) != PAD_PATTERN ||
- *(tmp + _stats.ObjectSize_ + i) != PAD_PATTERN)
- throw OAException(OAException::E_CORRUPTED_BLOCK,
- "Trying to free a corrupted block");
- }
- }
- /******************************************************************************/
- /*!
- \brief
- Remove the internal header of the block
- \param Object
- Pointer to the block to be freed
- */
- /******************************************************************************/
- void ObjectAllocator::RemoveInternalHeader(void * Object) throw(OAException)
- {
- char * header = reinterpret_cast<char*>(Object)-_config.PadBytes_-_headerSize;
- // Reset the data in the internal header
- if (_config.HBlockInfo_.type_ == OAConfig::hbBasic)
- {
- *(header + _headerSize - FLAGS_SIZE) = 0;
- *reinterpret_cast<unsigned *>(header) = 0;
- }
- else if (_config.HBlockInfo_.type_ == OAConfig::hbExtended)
- {
- *(header + _headerSize - FLAGS_SIZE) = 0;
- *reinterpret_cast<unsigned *>(
- header + _headerSize - FLAGS_SIZE - ALLOCATION_SIZE) = 0;
- }
- }
- /******************************************************************************/
- /*!
- \brief
- Free the memory allocated for the external header
- \param Object
- Pointer to the block to be freed
- */
- /******************************************************************************/
- void ObjectAllocator::RemoveExternalHeader(void * Object) throw(OAException)
- {
- char * header = reinterpret_cast<char *>(Object) -
- _config.PadBytes_ - _headerSize;
- MemBlockInfo * blockInfo =
- reinterpret_cast<MemBlockInfo *>(*reinterpret_cast<MemBlockInfo **>(header));
- blockInfo->in_use = false;
- delete [] blockInfo->label;
- blockInfo->label = 0;
- }
- /******************************************************************************/
- /*!
- \brief
- Free memory allocated for the page header
- */
- /******************************************************************************/
- void ObjectAllocator::RemovePageHeader()
- {
- char * tmp = _pageList + _pageHeadSize - _config.PadBytes_ - _headerSize;
- if (_config.HBlockInfo_.type_ == OAConfig::hbExternal)
- {
- MemBlockInfo *& blockInfo = *reinterpret_cast<MemBlockInfo **>(tmp);
- if (blockInfo)
- {
- if (blockInfo->label)
- delete[] blockInfo->label;
- delete[] blockInfo;
- blockInfo = 0;
- }
- }
- }
- /******************************************************************************/
- /*!
- \brief
- Free the memory allocated for the inter block header
- */
- /******************************************************************************/
- void ObjectAllocator::RemoveInterblockHeader()
- {
- char* currHeader = _pageList + _pageHeadSize + _blockSize -
- _config.PadBytes_ - _headerSize;
- // loop through and free the inter block header
- for (unsigned i = 0; i < _config.ObjectsPerPage_ - 1; ++i)
- {
- char * tmp = reinterpret_cast<char*>(currHeader) + _blockSize;
- if (_config.HBlockInfo_.type_ == OAConfig::hbExternal)
- {
- MemBlockInfo *& info = *(reinterpret_cast<MemBlockInfo **>(currHeader));
- if (info)
- {
- if (info->label)
- delete[] info->label;
- delete[] info;
- info = 0;
- }
- }
- currHeader = tmp;
- }
- }
- /******************************************************************************/
- /*!
- \brief
- Free the object using the c++ lib delete
- \param Object
- Pointer to the block to be freed
- */
- /******************************************************************************/
- void ObjectAllocator::CPPDelete(void * Object)
- {
- delete [] reinterpret_cast<char *>(Object);
- ++_stats.Deallocations_;
- ++_stats.FreeObjects_;
- --_stats.ObjectsInUse_;
- }
- /******************************************************************************/
- /*!
- \brief
- Dump memory of all the block that are still in use
- \param fn
- Function callback used to dump the memory
- */
- /******************************************************************************/
- unsigned ObjectAllocator::DumpMemoryInUse(DUMPCALLBACK fn) const
- {
- unsigned leakCounter = 0;
- GenericObject * currPage = reinterpret_cast<GenericObject *>(_pageList);
- // loop through all the pages and dump the memory
- while (currPage)
- {
- unsigned char * pageStart =
- reinterpret_cast<unsigned char *>(currPage) + _pageHeadSize;
- for (unsigned i = 0; i < _config.ObjectsPerPage_; ++i)
- {
- // dump memory of block still in use
- if (*pageStart == ALLOCATED_PATTERN)
- {
- fn(pageStart, _stats.ObjectSize_);
- ++leakCounter;
- }
- if (i != _config.ObjectsPerPage_ - 1) pageStart += _blockSize;
- }
- currPage = currPage->Next;
- }
- return leakCounter;
- }
- /******************************************************************************/
- /*!
- \brief
- Validate the pages
- \param fn
- Function callback to validate the pages
- */
- /******************************************************************************/
- unsigned ObjectAllocator::ValidatePages(VALIDATECALLBACK fn) const
- {
- unsigned corruptCounter = 0;
- GenericObject * currPage = reinterpret_cast<GenericObject *>(_pageList);
- while (currPage)
- {
- char * pageStart = reinterpret_cast<char *>(currPage) + _pageHeadSize;
- // loop to check current page
- for (unsigned i = 0; i < _config.ObjectsPerPage_; ++i)
- {
- // check for corrupted padding boundaries
- unsigned char * pad = reinterpret_cast<unsigned char *>(pageStart);
- for (unsigned j = 0; j < _config.PadBytes_; ++j)
- {
- // left padding
- if (*(pad - _config.PadBytes_ + j) != PAD_PATTERN)
- {
- fn(pad, _stats.ObjectSize_);
- ++corruptCounter;
- break;
- }
- // right padding
- if (*(pad + _stats.ObjectSize_ + j) != PAD_PATTERN)
- {
- fn(pad, _stats.ObjectSize_);
- ++corruptCounter;
- break;
- }
- }
- if (i != _config.ObjectsPerPage_ - 1)
- pageStart += _blockSize;
- }
- currPage = currPage->Next;
- }
- return corruptCounter;
- }
- /******************************************************************************/
- /*!
- \brief
- Free the memory allocated if the page is empty and not in use
- \return
- Number of pages freed
- */
- /******************************************************************************/
- unsigned ObjectAllocator::FreeEmptyPages(void)
- {
- unsigned count = 0;
- GenericObject *prevPage = reinterpret_cast<GenericObject *>(_pageList);
- GenericObject *currPage = reinterpret_cast<GenericObject *>(_pageList);
- // loop through all pages
- while (currPage)
- {
- bool isEmpty = true;
- unsigned offset = _pageHeadSize;
- // loop through all objects
- for (unsigned i = 0 ; i < _config.ObjectsPerPage_ ; ++i)
- {
- bool isFound = false;
- GenericObject *currFree = reinterpret_cast<GenericObject *>(_freeList);
- // loop through free list
- while (currFree)
- {
- if (reinterpret_cast<char *>(currPage) + offset ==
- reinterpret_cast<char*>(currFree))
- {
- isFound = true;
- break;
- }
- currFree = currFree->Next;
- }
- // found object that exists in the page from the free list
- if (!isFound)
- {
- isEmpty = false;
- break;
- }
- offset += _blockSize;
- }
- // clear page if empty
- if (isEmpty)
- {
- --_stats.PagesInUse_;
- _stats.FreeObjects_ -= _config.ObjectsPerPage_;
- ++count;
- // rebuild free list
- GenericObject *prevFree = reinterpret_cast<GenericObject *>(_freeList);
- GenericObject *currFree = reinterpret_cast<GenericObject *>(_freeList);
- // loop through the free list
- while (currFree)
- {
- // found in current page
- if (currPage < currFree &&
- reinterpret_cast<char *>(currPage) + _stats.PageSize_ >
- reinterpret_cast<char *>(currFree))
- {
- if (reinterpret_cast<char *>(currFree) == _freeList)
- _freeList = reinterpret_cast<char *>(currFree->Next);
- else
- prevFree->Next = currFree->Next;
- }
- else
- prevFree = currFree;
- currFree = currFree->Next;
- }
- // relink previous page to next page
- if (reinterpret_cast<char *>(currPage) == _pageList)
- _pageList = reinterpret_cast<char *>(currPage->Next);
- else
- prevPage->Next = currPage->Next;
- if (_config.HBlockInfo_.type_ == OAConfig::hbExternal)
- {
- RemovePageHeader();
- RemoveInterblockHeader();
- }
- // delete page
- GenericObject* temp = currPage;
- currPage = currPage->Next;
- delete[] temp;
- }
- else
- {
- prevPage = currPage;
- currPage = currPage->Next;
- }
- }
- return count;
- }
- /******************************************************************************/
- /*!
- \brief
- Check if the location to be freed is in bad bounds
- \return
- Return true if implemented extra credits, false if otherwise
- */
- /******************************************************************************/
- bool ObjectAllocator::ImplementedExtraCredit(void)
- {
- return true;
- }
- /******************************************************************************/
- /*!
- \brief
- Set the config debug state
- \param State
- Boolean to on/off the debug state
- */
- /******************************************************************************/
- void ObjectAllocator::SetDebugState(bool State)
- {
- _config.DebugOn_ = State;
- }
- /******************************************************************************/
- /*!
- \brief
- Get pointer to the free list
- \return
- Pointer to the free list of the OA
- */
- /******************************************************************************/
- const void* ObjectAllocator::GetFreeList(void) const
- {
- return _freeList;
- }
- /******************************************************************************/
- /*!
- \brief
- Get pointer to the page list
- \return
- Pointer to the page list of the OA
- */
- /******************************************************************************/
- const void* ObjectAllocator::GetPageList(void) const
- {
- return _pageList;
- }
- /******************************************************************************/
- /*!
- \brief
- Get the config for the OA
- \return
- Config of the OA
- */
- /******************************************************************************/
- OAConfig ObjectAllocator::GetConfig(void) const
- {
- return _config;
- }
- /******************************************************************************/
- /*!
- \brief
- Get the stats of the OA
- \return
- Stats of the OA
- */
- /******************************************************************************/
- OAStats ObjectAllocator::GetStats(void) const
- {
- return _stats;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement