00001
00004 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXMEMORYALLOCATOR_H
00005 #define FBXFILESDK_KFBXPLUGINS_KFBXMEMORYALLOCATOR_H
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include <fbxfilesdk/fbxfilesdk_def.h>
00042
00043 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00044
00055 class KFBX_DLL KFbxMemoryAllocator
00056 {
00057 public:
00065 KFbxMemoryAllocator(void* (*pMallocHandler)(size_t),
00066 void* (*pCallocHandler)(size_t,size_t),
00067 void* (*pReallocHandler)(void*,size_t),
00068 void (*pFreeHandler)(void*),
00069 size_t (*pMsizeHandler)(void*))
00070 : mMallocHandler(pMallocHandler)
00071 , mCallocHandler(pCallocHandler)
00072 , mReallocHandler(pReallocHandler)
00073 , mFreeHandler(pFreeHandler)
00074 , mMsizeHandler(pMsizeHandler)
00075 , mMallocHandler_debug(0)
00076 , mCallocHandler_debug(0)
00077 , mReallocHandler_debug(0)
00078 , mFreeHandler_debug(0)
00079 , mMsizeHandler_debug(0)
00080 {
00081 }
00082
00095 KFbxMemoryAllocator(void* (*pMallocHandler)(size_t),
00096 void* (*pCallocHandler)(size_t,size_t),
00097 void* (*pReallocHandler)(void*,size_t),
00098 void (*pFreeHandler)(void*),
00099 size_t (*pMsizeHandler)(void*),
00100 void* (*pMallocHandler_debug)(size_t,int,const char *,int),
00101 void* (*pCallocHandler_debug)(size_t, size_t,int,const char *,int),
00102 void* (*pReallocHandler_debug)(void*, size_t,int,const char *,int),
00103 void (*pFreeHandler_debug)(void*,int),
00104 size_t (*pMsizeHandler_debug)(void*,int)
00105 )
00106 : mMallocHandler(pMallocHandler)
00107 , mCallocHandler(pCallocHandler)
00108 , mReallocHandler(pReallocHandler)
00109 , mFreeHandler(pFreeHandler)
00110 , mMsizeHandler(pMsizeHandler)
00111 , mMallocHandler_debug(pMallocHandler_debug)
00112 , mCallocHandler_debug(pCallocHandler_debug)
00113 , mReallocHandler_debug(pReallocHandler_debug)
00114 , mFreeHandler_debug(pFreeHandler_debug)
00115 , mMsizeHandler_debug(pMsizeHandler_debug)
00116 {
00117 }
00118 virtual ~KFbxMemoryAllocator() = 0;
00119
00120 void* (*mMallocHandler)(size_t);
00121 void* (*mCallocHandler)(size_t,size_t);
00122 void* (*mReallocHandler)(void*,size_t);
00123 void (*mFreeHandler)(void*);
00124 size_t (*mMsizeHandler)(void*);
00125 void* (*mMallocHandler_debug)(size_t,int,const char *,int);
00126 void* (*mCallocHandler_debug)(size_t, size_t,int,const char *,int);
00127 void* (*mReallocHandler_debug)(void*, size_t,int,const char *,int);
00128 void (*mFreeHandler_debug)(void*,int);
00129 size_t (*mMsizeHandler_debug)(void*,int);
00130 };
00131
00136 class KFBX_DLL KFbxDefaultMemoryAllocator : public KFbxMemoryAllocator
00137 {
00138 public:
00139 KFbxDefaultMemoryAllocator();
00140 ~KFbxDefaultMemoryAllocator();
00141 };
00142
00143 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00144
00145 #endif // FBXFILESDK_KFBXPLUGINS_KFBXMEMORYALLOCATOR_H
00146