OROCHI
 
Loading...
Searching...
No Matches
GxAllocator Class Reference

メモリアロケータ基底クラス More...

#include <GxAllocator.h>

Inheritance diagram for GxAllocator:
Collaboration diagram for GxAllocator:

Public Member Functions

アクセサ
constexpr void * getAddress (void) const
 確保アドレス取得
 
constexpr u32 getSize (void) const
 確保サイズ取得
 
constexpr u32 getAttribute (void) const
 アトリビュート取得
 
constexpr void setAttribute (u32 attribute)
 アトリビュート設定
 
constexpr void addAttribute (u32 attribute)
 アトリビュート追加
 
constexpr GxMemory::TYPE getMemoryType (void) const
 メモリ確保タイプ取得
 
- Public Member Functions inherited from GxClassBase
constexpr GxClassBase (void)
 コンストラクタ
 
constexpr GxClassBase (const GxClassBase &base)
 コピーコンストラクタ
 
 ~GxClassBase (void) override
 デストラクタ
 
- Public Member Functions inherited from GxClassBaseRoot
constexpr GxClassBaseRoot (void)
 コンストラクタ
 
constexpr GxClassBaseRoot (const GxClassBaseRoot &)
 コピーコンストラクタ
 
virtual ~GxClassBaseRoot (void)
 デストラクタ
 
constexpr GxClassBaseRootoperator= (const GxClassBaseRoot &)
 代入演算子
 
virtual GxRttigetRtti (void) const =0
 Rttiの取得
 
virtual GX_FORCE_INLINE const GxTypedObjectgetDefaultObject (void)
 デフォルトオブジェクトを取得
 
GX_FORCE_INLINE b32 isDefaultObject (void)
 デフォルトオブジェクト判定
 

Protected Attributes

メンバ変数
GxCriticalSection _criticalSection
 クリティカルセクション
 
void * _pAddress
 確保アドレス
 
u32 _size
 確保サイズ
 
u32 _attribute
 属性
 
GxMemory::TYPE _type
 メモリ確保タイプ
 

定義

enum  ATTRIBUTE {
  ATTRIBUTE_ZERO_CLEAR = (1 << 0) , ATTRIBUTE_THREAD_SAFE = (1 << 1) , ATTRIBUTE_SEQUENTIAL_THREAD_SAFE = (1 << 2) , ATTRIBUTE_TRACE = (1 << 3) ,
  ATTRIBUTE_LOCKED_TRACE = (1 << 4)
}
 属性 More...
 
static constexpr u32 ALLOCATE_TYPE_DEFAULT = 0
 ディフォルト値
 

初期化

 GxAllocator (void)
 ディフォルトコンストラクタ
 
 GxAllocator (GxMemory::TYPE type, GX_CSTR name)
 コンストラクタ
 
 ~GxAllocator (void) override
 デストラクタ
 

操作

void lock (void)
 スレッドロック
 
void unlock (void)
 スレッドアンロック
 
void initializeAllocateBuffer (void *pAddress, u32 size)
 確保メモリ初期化
 
void terminateAllocateBuffer (void *pAddress, u32 size)
 確保メモリ終了
 
virtual void * allocateMemory (u32 type, u32 size, GxMemory::ALIGNMENT alignment=GxMemory::ALIGNMENT::_16)
 メモリ確保
 
virtual void freeMemory (void *pAddress)
 メモリ解放
 
virtual void * reallocMemory (void *pAddress, u32 size)
 メモリ割り当てサイズ変更
 
virtual b32 isValidAddr (const void *pAddress)
 メモリ範囲チェック
 

Additional Inherited Members

- Static Public Member Functions inherited from GxClassBaseRoot
static GX_FORCE_INLINE GxRtti__getStaticRtti (void)
 Rttiの取得
 

Detailed Description

メモリアロケータ基底クラス

Member Enumeration Documentation

◆ ATTRIBUTE

属性

Enumerator
ATTRIBUTE_ZERO_CLEAR 

確保時に0クリア

ATTRIBUTE_THREAD_SAFE 

スレッド間の排他処理を有効にします

ATTRIBUTE_SEQUENTIAL_THREAD_SAFE 

シーケンシャルスレッドマルチ動作間の排他処理を有効にします

ATTRIBUTE_TRACE 

メモリ確保・解放時にログを出力

ATTRIBUTE_LOCKED_TRACE 

ロック・アンロック時にログを出力

Constructor & Destructor Documentation

◆ GxAllocator()

GxAllocator::GxAllocator ( GxMemory::TYPE type,
GX_CSTR name )
protected

コンストラクタ

Parameters
type[in] メモリ確保タイプ
name[in] アロケータ名

Member Function Documentation

◆ allocateMemory()

void * GxAllocator::allocateMemory ( u32 type,
u32 size,
GxMemory::ALIGNMENT alignment = GxMemory::ALIGNMENT::_16 )
virtual

メモリ確保

Parameters
type[in] 確保タイプ (※未使用)
size[in] 確保サイズ
filename[in] 呼び出し元ファイル名 (※DEBUG時のみ)
line[in] 呼び出し元ソースライン番号 (※DEBUG時のみ)
alignment[in] メモリアライメント
Returns
確保メモリアドレス

Reimplemented in GxAllocatorFrame, and GxAllocatorHeap.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freeMemory()

void GxAllocator::freeMemory ( void * pAddress)
virtual

メモリ解放

Parameters
pAddress[in] 解放アドレス
filename[in] 呼び出し元ファイル名 (※DEBUG時のみ)
line[in] 呼び出し元ソースライン番号 (※DEBUG時のみ)

Reimplemented in GxAllocatorFrame, and GxAllocatorHeap.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializeAllocateBuffer()

GX_FORCE_INLINE void GxAllocator::initializeAllocateBuffer ( void * pAddress,
u32 size )
protected

確保メモリ初期化

Parameters
pAddress[in,out] 確保メモリポインタ
size[in] 確保サイズ

◆ isValidAddr()

b32 GxAllocator::isValidAddr ( const void * pAddress)
virtual

メモリ範囲チェック

Parameters
pAddress[in] チェックアドレス
Returns
対象アドレスはアロケータの確保領域内ならtrue

◆ reallocMemory()

void * GxAllocator::reallocMemory ( void * pAddress,
u32 size )
virtual

メモリ割り当てサイズ変更

Parameters
pAddress[in] 変更元アドレス
size[in] 変更後サイズ
filename[in] 呼び出し元ファイル名 (※DEBUG時のみ)
line[in] 呼び出し元ソースライン番号 (※DEBUG時のみ)
Returns
変更後メモリアドレス (nullptrの場合:再確保失敗)

Reimplemented in GxAllocatorHeap.

◆ terminateAllocateBuffer()

GX_FORCE_INLINE void GxAllocator::terminateAllocateBuffer ( void * pAddress,
u32 size )
protected

確保メモリ終了

Parameters
pAddress[in,out] 確保メモリポインタ
size[in] 確保サイズ

The documentation for this class was generated from the following files: