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

フレームアロケータ More...

#include <GxAllocatorFrame.h>

Inheritance diagram for GxAllocatorFrame:
Collaboration diagram for GxAllocatorFrame:

Classes

struct  GxMemoryStateHandle
 メモリ確保状態保存情報ハンドル More...
 

Public Member Functions

操作
void * allocateMemory (u32 type, u32 size, GxMemory::ALIGNMENT alignment=ALLOCATE_ALIGNMENT) override
 メモリ確保 (operator new用)
 
void freeMemory (void *pAddress) override
 メモリ解放 (operator delete用)
 
void freeMemoryHead (void)
 メモリ前方解放
 
void freeMemoryTail (void)
 メモリ後方解放
 
void freeMemoryAll (void)
 メモリ全解放
 
void recordMemoryState (GxMemoryStateHandle &record)
 メモリ確保状態の保存
 
b32 returnMemoryState (const GxMemoryStateHandle &record, MEMORYSTATE_RETURN_TYPE type=MEMORYSTATE_RETURN_TYPE::ALL)
 メモリ確保状態の復帰
 
size_t getUsedSizeHead (void) const
 現在の使用サイズを返す
 
アクセサ
u32 getAllocatableMaxSize (GxMemory::ALIGNMENT alignment=ALLOCATE_ALIGNMENT)
 確保可能最大サイズ取得
 
- Public Member Functions inherited from GxAllocator
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
 メモリ確保タイプ取得
 
 ~GxAllocator (void) override
 デストラクタ
 
virtual void * reallocMemory (void *pAddress, u32 size)
 メモリ割り当てサイズ変更
 
virtual b32 isValidAddr (const void *pAddress)
 メモリ範囲チェック
 
- 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)
 デフォルトオブジェクト判定
 

定義

enum class  ALLOCATE_TYPE { HEAD = 0 , TAIL }
 メモリ確保手法 More...
 
enum class  MEMORYSTATE_RETURN_TYPE { ALL = 0 , HEAD , TAIL }
 メモリ確保状態復帰タイプ More...
 

初期化

 GxAllocatorFrame (void)
 デフォルトコンストラクタ (クラス外での使用禁止)
 
 GxAllocatorFrame (GX_CSTR name, GxMemory::TYPE type, u32 size)
 コンストラクタ (メモリ内部確保)
 
 ~GxAllocatorFrame (void)
 デストラクタ
 
void reset (void *pAddress, u32 size)
 メモリ指定破棄(destroy せずにリセットのみ)
 
static GxAllocatorFramecreate (void *pAddress, u32 size)
 メモリ指定生成
 
static void destroy (GxAllocatorFrame *&pAllocator)
 メモリ指定破棄
 

Additional Inherited Members

- Public Types inherited from GxAllocator
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 Public Member Functions inherited from GxClassBaseRoot
static GX_FORCE_INLINE GxRtti__getStaticRtti (void)
 Rttiの取得
 
- Static Public Attributes inherited from GxAllocator
static constexpr u32 ALLOCATE_TYPE_DEFAULT = 0
 ディフォルト値
 
- Protected Member Functions inherited from GxAllocator
 GxAllocator (void)
 ディフォルトコンストラクタ
 
 GxAllocator (GxMemory::TYPE type, GX_CSTR name)
 コンストラクタ
 
void lock (void)
 スレッドロック
 
void unlock (void)
 スレッドアンロック
 
void initializeAllocateBuffer (void *pAddress, u32 size)
 確保メモリ初期化
 
void terminateAllocateBuffer (void *pAddress, u32 size)
 確保メモリ終了
 
- Protected Attributes inherited from GxAllocator
GxCriticalSection _criticalSection
 クリティカルセクション
 
void * _pAddress
 確保アドレス
 
u32 _size
 確保サイズ
 
u32 _attribute
 属性
 
GxMemory::TYPE _type
 メモリ確保タイプ
 

Detailed Description

フレームアロケータ

Member Enumeration Documentation

◆ ALLOCATE_TYPE

メモリ確保手法

Enumerator
HEAD 

先頭側から確保

TAIL 

終端側から確保

◆ MEMORYSTATE_RETURN_TYPE

メモリ確保状態復帰タイプ

Enumerator
ALL 

先頭、終端両方

HEAD 

先頭のみ

TAIL 

終端のみ

Constructor & Destructor Documentation

◆ GxAllocatorFrame()

GxAllocatorFrame::GxAllocatorFrame ( GX_CSTR name,
GxMemory::TYPE type,
u32 size )

コンストラクタ (メモリ内部確保)

Parameters
name[in] アロケータ名 (※開発時のみ有効)
type[in] メモリ確保タイプ
size[in] アロケータ割り当てサイズ
Here is the call graph for this function:

Member Function Documentation

◆ allocateMemory()

void * GxAllocatorFrame::allocateMemory ( u32 type,
u32 size,
GxMemory::ALIGNMENT alignment = ALLOCATE_ALIGNMENT )
overridevirtual

メモリ確保 (operator new用)

Parameters
type[in] 確保タイプ (※ALLOCATE_TYPEを指定する)
size[in] 確保サイズ
filename[in] 呼び出し元ファイル名 (※未使用・DEBUG時のみ)
line[in] 呼び出し元ソースライン番号 (※未使用・DEBUG時のみ)
alignment[in] メモリアライメント
Returns
確保メモリアドレス (nullptrの場合、失敗 ※サイズ不足)

Reimplemented from GxAllocator.

Here is the call graph for this function:

◆ create()

GxAllocatorFrame * GxAllocatorFrame::create ( void * pAddress,
u32 size )
static

メモリ指定生成

Parameters
pAddress[in] フレームアロケータ生成バッファポインタ
size[in] フレームアロケータサイズ
Returns
フレームアロケータポインタ
Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroy()

void GxAllocatorFrame::destroy ( GxAllocatorFrame *& pAllocator)
static

メモリ指定破棄

Parameters
pAllocator[in,out] メモリ指定生成にて取得したフレームアロケータポインタ
Note
セーフ破棄
Here is the caller graph for this function:

◆ freeMemory()

void GxAllocatorFrame::freeMemory ( void * pAddress)
overridevirtual

メモリ解放 (operator delete用)

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

Reimplemented from GxAllocator.

◆ getAllocatableMaxSize()

u32 GxAllocatorFrame::getAllocatableMaxSize ( GxMemory::ALIGNMENT alignment = ALLOCATE_ALIGNMENT)

確保可能最大サイズ取得

Parameters
alignment[in] アライメント指定
Returns
確保可能最大サイズ
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUsedSizeHead()

size_t GxAllocatorFrame::getUsedSizeHead ( void ) const

現在の使用サイズを返す

Returns
使用サイズ

◆ recordMemoryState()

void GxAllocatorFrame::recordMemoryState ( GxMemoryStateHandle & record)

メモリ確保状態の保存

Parameters
record[out] 保存状態ハンドル出力先
Here is the call graph for this function:

◆ reset()

void GxAllocatorFrame::reset ( void * pAddress,
u32 size )

メモリ指定破棄(destroy せずにリセットのみ)

Parameters
pAddress[in] アドレス
size[in] サイズ
Here is the call graph for this function:
Here is the caller graph for this function:

◆ returnMemoryState()

b32 GxAllocatorFrame::returnMemoryState ( const GxMemoryStateHandle & record,
MEMORYSTATE_RETURN_TYPE type = MEMORYSTATE_RETURN_TYPE::ALL )

メモリ確保状態の復帰

Parameters
record[in] 復帰保存状態ハンドル
type[in] 復帰タイプ (全部 or 先頭のみ or 終端のみ)
Returns
成功ならtrue
Here is the call graph for this function:

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