fbxsdk/core/base/fbxmemorypool.h Source File
 
 
 
fbxsdk/core/base/fbxmemorypool.h
Go to the documentation of this file.
00001 /****************************************************************************************
00002  
00003    Copyright (C) 2013 Autodesk, Inc.
00004    All rights reserved.
00005  
00006    Use of this software is subject to the terms of the Autodesk license agreement
00007    provided at the time of installation or download, or which otherwise accompanies
00008    this software in either electronic or hard copy form.
00009  
00010 ****************************************************************************************/
00011 
00013 #ifndef _FBXSDK_CORE_BASE_MEMORY_H_
00014 #define _FBXSDK_CORE_BASE_MEMORY_H_
00015 
00016 #include <fbxsdk/fbxsdk_def.h>
00017 
00018 #include <fbxsdk/core/sync/fbxatomic.h>
00019 
00020 #include <fbxsdk/fbxsdk_nsbegin.h>
00021 
00023 class FBXSDK_DLL FbxMemoryPool
00024 {
00025 public:
00033         FbxMemoryPool(size_t pBlockSize, FbxInt64 pBlockCount=0, bool pAlignment=false, bool pResizable=true, bool pConcurrent=true);
00034 
00036         ~FbxMemoryPool();
00037 
00040         void Reset();
00041 
00044         void* Allocate();
00045 
00048         void Release(void* pMemBlock);
00049 
00050 /*****************************************************************************************************************************
00051 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
00052 *****************************************************************************************************************************/
00053 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00054 private:
00055     void*               Pop();
00056 
00057         FbxInt64        mMaxBlockCount;
00058     FbxAtomic   mFreeBlockCount;
00059     void*               mFreeBlocksStack;
00060     size_t              mBlockSize;
00061     bool                mAlignment;
00062     bool                mResizable;
00063     bool                mSupportConcurrentAccess;
00064 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
00065 };
00066 
00067 #include <fbxsdk/fbxsdk_nsend.h>
00068 
00069 #endif /* _FBXSDK_CORE_BASE_MEMORY_H_ */