FBX C++ API Reference
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fbxalloc.h File Reference
#include <fbxsdk/fbxsdk_def.h>
#include <malloc.h>
#include <fbxsdk/fbxsdk_nsbegin.h>
#include <fbxsdk/fbxsdk_nsend.h>

File Description

Allocation functions definition.

It is possible to override memory allocation functions throughout the FBX SDK by providing system memory allocation functions using the handler set functions below. The Microsoft Windows implementation in debug mode allows to specify where the allocations happen by providing the standard block type, file name and line number.

Definition in file fbxalloc.h.

Classes

class  FbxDeletionPolicyDefault< Type >
 Deletion policy for pointer template classes that uses the delete operator. More...
 
class  FbxDeletionPolicyDelete< Type >
 
class  FbxDeletionPolicyFree< Type >
 Deletion policy for pointer template classes that uses the FbxFree() function. More...
 
class  FbxDeletionPolicyObject< Type >
 Deletion policy for pointer template classes that uses the Destroy() function. More...
 
class  FbxAutoPtr< Type, Policy >
 FbxAutoPtr mimics the auto_ptr class template implementation available in the C++ Standard Library. More...
 
class  FbxAutoFreePtr< Type >
 Scoped pointer for FbxMalloc allocations, which call FbxFree() to deallocate. More...
 
class  FbxAutoDeletePtr< Type >
 Scoped pointer for FbxNew allocations, which call FbxDelete() to deallocate. More...
 
class  FbxAutoDestroyPtr< Type >
 Scoped pointer for FbxObject derived classes, which call Destroy() to deallocate. More...
 
class  RefCount
 FbxSharedPtr class describes an object that stores a pointer to a single allocated object of type Type* that ensures that the object to which it points gets destroyed automatically when the control leaves a scope and the reference count is 0. More...
 
class  FbxSharedPtr< Type, Policy >
 
class  FbxSharedFreePtr< Type >
 Scoped pointer for FbxMalloc allocations, which call FbxFree() to deallocate. More...
 
class  FbxSharedDeletePtr< Type >
 Scoped pointer for FbxNew allocations, which call FbxDelete() to deallocate. More...
 
class  FbxSharedDestroyPtr< Type >
 Scoped pointer for FbxObject derived classes, which call Destroy() to deallocate. More...
 

Macros

#define FBXSDK_MEMORY_ALIGNMENT   ((size_t)16U)
 
#define FBXSDK_MEMORY_COPY(dst, src, size)   {memcpy(dst,src,size);}
 

Typedefs

typedef void *(* FbxMallocProc) (size_t)
 
typedef void *(* FbxCallocProc) (size_t, size_t)
 Function pointer signature used to replace "malloc". More...
 
typedef void *(* FbxReallocProc) (void *, size_t)
 Function pointer signature used to replace "calloc". More...
 
typedef void(* FbxFreeProc) (void *)
 Function pointer signature used to replace "realloc". More...
 

Functions

void FbxSetMallocHandler (FbxMallocProc pHandler)
 Function pointer signature used to replace "free". More...
 
void FbxSetCallocHandler (FbxCallocProc pHandler)
 Set the global zero'd memory allocation function used internally by the FBX SDK. More...
 
void FbxSetReallocHandler (FbxReallocProc pHandler)
 Set the global memory re-allocation function used internally by the FBX SDK. More...
 
void FbxSetFreeHandler (FbxFreeProc pHandler)
 Set the global memory freeing function used internally by the FBX SDK. More...
 
FbxMallocProc FbxGetMallocHandler ()
 Get the global memory allocation function used internally by the FBX SDK. More...
 
FbxCallocProc FbxGetCallocHandler ()
 Get the global zero'd memory allocation function used internally by the FBX SDK. More...
 
FbxReallocProc FbxGetReallocHandler ()
 Get the global memory re-allocation function used internally by the FBX SDK. More...
 
FbxFreeProc FbxGetFreeHandler ()
 Get the global memory freeing function used internally by the FBX SDK. More...
 
FbxMallocProc FbxGetDefaultMallocHandler ()
 Get the default global memory allocation function used internally by the FBX SDK. More...
 
FbxCallocProc FbxGetDefaultCallocHandler ()
 Get the default global zero'd memory allocation function used internally by the FBX SDK. More...
 
FbxReallocProc FbxGetDefaultReallocHandler ()
 Get the default global memory re-allocation function used internally by the FBX SDK. More...
 
FbxFreeProc FbxGetDefaultFreeHandler ()
 Get the default global memory freeing function used internally by the FBX SDK. More...
 
template<typename T >
void FbxDelete (T *p)
 Deletion policy for pointer template classes that uses the FbxDelete() function. More...
 
template<typename T >
void FbxDelete (const T *p)
 

Macro Definition Documentation

◆ FBXSDK_MEMORY_ALIGNMENT

#define FBXSDK_MEMORY_ALIGNMENT   ((size_t)16U)
Examples:
ViewScene/main.cxx.

Definition at line 40 of file fbxalloc.h.

◆ FBXSDK_MEMORY_COPY

#define FBXSDK_MEMORY_COPY (   dst,
  src,
  size 
)    {memcpy(dst,src,size);}

Definition at line 43 of file fbxalloc.h.

Typedef Documentation

◆ FbxMallocProc

typedef void*(* FbxMallocProc) (size_t)

Definition at line 45 of file fbxalloc.h.

◆ FbxCallocProc

typedef void*(* FbxCallocProc) (size_t, size_t)

Function pointer signature used to replace "malloc".

Definition at line 46 of file fbxalloc.h.

◆ FbxReallocProc

typedef void*(* FbxReallocProc) (void *, size_t)

Function pointer signature used to replace "calloc".

Definition at line 47 of file fbxalloc.h.

◆ FbxFreeProc

typedef void(* FbxFreeProc) (void *)

Function pointer signature used to replace "realloc".

Definition at line 48 of file fbxalloc.h.

Function Documentation

◆ FbxSetMallocHandler()

void FbxSetMallocHandler ( FbxMallocProc  pHandler)

Function pointer signature used to replace "free".

Set the global memory allocation function used internally by the FBX SDK.

Parameters
pHandlerFunction pointer that implements the necessary procedure to allocate memory in the system.
Examples:
ViewScene/main.cxx.

◆ FbxSetCallocHandler()

void FbxSetCallocHandler ( FbxCallocProc  pHandler)

Set the global zero'd memory allocation function used internally by the FBX SDK.

Parameters
pHandlerFunction pointer that implements the necessary procedure to allocate zero'd memory in the system.
Examples:
ViewScene/main.cxx.

◆ FbxSetReallocHandler()

void FbxSetReallocHandler ( FbxReallocProc  pHandler)

Set the global memory re-allocation function used internally by the FBX SDK.

Parameters
pHandlerFunction pointer that implements the necessary procedure to re-allocate memory in the system.
Examples:
ViewScene/main.cxx.

◆ FbxSetFreeHandler()

void FbxSetFreeHandler ( FbxFreeProc  pHandler)

Set the global memory freeing function used internally by the FBX SDK.

Parameters
pHandlerFunction pointer that implements the necessary procedure to free memory in the system.
Examples:
ViewScene/main.cxx.

◆ FbxGetMallocHandler()

FbxMallocProc FbxGetMallocHandler ( )

Get the global memory allocation function used internally by the FBX SDK.

Returns
pHandler Function pointer on FBX's internal malloc

◆ FbxGetCallocHandler()

FbxCallocProc FbxGetCallocHandler ( )

Get the global zero'd memory allocation function used internally by the FBX SDK.

Returns
pHandler Function pointer on FBX's internal calloc

◆ FbxGetReallocHandler()

FbxReallocProc FbxGetReallocHandler ( )

Get the global memory re-allocation function used internally by the FBX SDK.

Returns
pHandler Function pointer on FBX's internal realloc

◆ FbxGetFreeHandler()

FbxFreeProc FbxGetFreeHandler ( )

Get the global memory freeing function used internally by the FBX SDK.

Returns
pHandler Function pointer on FBX's internal free

◆ FbxGetDefaultMallocHandler()

FbxMallocProc FbxGetDefaultMallocHandler ( )

Get the default global memory allocation function used internally by the FBX SDK.

Returns
pHandler Function pointer on FBX's internal malloc

◆ FbxGetDefaultCallocHandler()

FbxCallocProc FbxGetDefaultCallocHandler ( )

Get the default global zero'd memory allocation function used internally by the FBX SDK.

Returns
pHandler Function pointer on FBX's internal calloc

◆ FbxGetDefaultReallocHandler()

FbxReallocProc FbxGetDefaultReallocHandler ( )

Get the default global memory re-allocation function used internally by the FBX SDK.

Returns
pHandler Function pointer on FBX's internal realloc

◆ FbxGetDefaultFreeHandler()

FbxFreeProc FbxGetDefaultFreeHandler ( )

Get the default global memory freeing function used internally by the FBX SDK.

Returns
pHandler Function pointer on FBX's internal free

◆ FbxDelete() [1/2]

void FbxDelete ( T *  p)

Deletion policy for pointer template classes that uses the FbxDelete() function.

Definition at line 341 of file fbxnew.h.

342 {
343  if( p )
344  {
345  ((T*)p)->~T();
346  FbxFree(p);
347  }
348 }

◆ FbxDelete() [2/2]

void FbxDelete ( const T *  p)

Definition at line 350 of file fbxnew.h.

351 {
352  if( p )
353  {
354  ((T*)p)->~T();
355  FbxFree(const_cast<T*>(p));
356  }
357 }

Go to the source code of this file.