fbxsdk/core/base/fbxmemorypool.h Source File

fbxmemorypool.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2015 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
13 #ifndef _FBXSDK_CORE_BASE_MEMORY_H_
14 #define _FBXSDK_CORE_BASE_MEMORY_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
19 
20 #include <fbxsdk/fbxsdk_nsbegin.h>
21 
24 {
25 public:
32  FbxMemoryPool(size_t pBlockSize, FbxInt64 pBlockCount=0, bool pResizable=true, bool pConcurrent=true);
33 
35  ~FbxMemoryPool();
36 
39  void Reset();
40 
43  void* Allocate();
44 
47  void Release(void* pMemBlock);
48 
49 /*****************************************************************************************************************************
50 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
51 *****************************************************************************************************************************/
52 #ifndef DOXYGEN_SHOULD_SKIP_THIS
53 private:
54  void* Pop();
55 
56  FbxInt64 mMaxBlockCount;
57  FbxAtomic mFreeBlockCount;
58  void* mFreeBlocksStack;
59  size_t mBlockSize;
60  bool mResizable;
61  bool mSupportConcurrentAccess;
62 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
63 };
64 
65 #include <fbxsdk/fbxsdk_nsend.h>
66 
67 #endif /* _FBXSDK_CORE_BASE_MEMORY_H_ */
FBX SDK environment definition.
Class to create a simple fixed-size-blocks memory pool to allocate memory dynamically.
Definition: fbxmemorypool.h:23
signed long long FbxInt64
Definition: fbxtypes.h:81
#define FBXSDK_DLL
Definition: fbxarch.h:173