OROCHI
 
Loading...
Searching...
No Matches
GxAllocator.h File Reference

アロケータ関連 More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  GxAllocator
 メモリアロケータ基底クラス More...
 
class  GxAllocatorList
 メモリアロケータリスト More...
 
struct  GxAllocatorList::GxCreateInformation
 アロケータ生成情報 More...
 
class  GxScopedTemporaryBuffer
 一時確保バッファクラス (※スコープ外で自動解放) More...
 

Macros

#define GX_ALLOCATE_MEMORY(pAllocatorList, size)
 
#define GX_ALLOCATE_MEMORY_NAME(pAllocatorList, size, name)
 
#define GX_ALLOCATE_MEMORY_ALIGNMENT(pAllocatorList, size, alignment)
 
#define GX_ALLOCATE_MEMORY_ALIGNMENT_NAME(pAllocatorList, size, alignment, name)
 
#define GX_ALLOCATE_MEMORY_TYPE(allocator, type, size)
 
#define GX_ALLOCATE_MEMORY_TYPE_NAME(allocator, type, size, name)
 
#define GX_ALLOCATE_MEMORY_TYPE_ALIGNMENT(allocator, type, size, alignment)
 
#define GX_ALLOCATE_MEMORY_TYPE_ALIGNMENT_NAME(allocator, type, size, alignment, name)
 
#define GX_SAFE_FREE_MEMORY(pAddress)
 
#define GX_SAFE_FREE_MEMORY_NAME(pAddress, name)
 
#define GX_SAFE_FREE_MEMORY_ALLOCATOR(pAddress, allocator)
 
#define GX_SAFE_FREE_MEMORY_ALLOCATOR_NAME(pAddress, allocator, name)
 
#define GX_REALLOC_MEMORY(pAddress, size)
 
#define GX_REALLOC_MEMORY_NAME(pAddress, size, name)
 
new, delete演算子定義
#define GX_OPERATOR_NEW_DELETE(allcatorNumber)
 
#define GX_OPERATOR_NEW_DELETE_USE_ARRAY(allcatorNumber)
 

Functions

GX_FORCE_INLINE GxAllocatorListgetGxAllocatorList (GxAllocatorList::ALLOCATOR_TYPE index)
 

Detailed Description

アロケータ関連

Author
Copyright (C)2009 SiliconStudio Inc. All rights reserved.
Takashi Taketa
Tahir Arai

Macro Definition Documentation

◆ GX_ALLOCATE_MEMORY

#define GX_ALLOCATE_MEMORY ( pAllocatorList,
size )
Value:
((pAllocatorList)->getAllocator())->allocateMemory((pAllocatorList)->getType(), size)

メモリ確保マクロ関数

Parameters
pAllocatorList[in] アロケータリストポインタ
size[in] 確保サイズ
name[in] デバッグ用識別文字列
Returns
確保メモリ

◆ GX_ALLOCATE_MEMORY_ALIGNMENT

#define GX_ALLOCATE_MEMORY_ALIGNMENT ( pAllocatorList,
size,
alignment )
Value:
((pAllocatorList)->getAllocator())->allocateMemory((pAllocatorList)->getType(), size, alignment)

メモリ確保マクロ関数 (アライメント指定)

Parameters
pAllocatorList[in] アロケータリストポインタ
size[in] 確保サイズ
alignment[in] メモリアライメント
name[in] デバッグ用識別文字列
Returns
確保メモリ

◆ GX_ALLOCATE_MEMORY_ALIGNMENT_NAME

#define GX_ALLOCATE_MEMORY_ALIGNMENT_NAME ( pAllocatorList,
size,
alignment,
name )
Value:
((pAllocatorList)->getAllocator())->allocateMemory((pAllocatorList)->getType(), size, alignment)

◆ GX_ALLOCATE_MEMORY_NAME

#define GX_ALLOCATE_MEMORY_NAME ( pAllocatorList,
size,
name )
Value:
((pAllocatorList)->getAllocator())->allocateMemory((pAllocatorList)->getType(), size)

◆ GX_ALLOCATE_MEMORY_TYPE

#define GX_ALLOCATE_MEMORY_TYPE ( allocator,
type,
size )
Value:
(allocator)->allocateMemory(type, size)

メモリ確保マクロ関数 (タイプ指定)

Parameters
allocator[in] アロケータポインタ
type[in] 確保タイプ
size[in] 確保サイズ
name[in] デバッグ用識別文字列
Returns
確保メモリ

◆ GX_ALLOCATE_MEMORY_TYPE_ALIGNMENT

#define GX_ALLOCATE_MEMORY_TYPE_ALIGNMENT ( allocator,
type,
size,
alignment )
Value:
(allocator)->allocateMemory(type, size, alignment)

メモリ確保マクロ関数 (タイプ指定,アライメント指定)

Parameters
allocator[in] アロケータポインタ
type[in] 確保タイプ
size[in] 確保サイズ
alignment[in] メモリアライメント
name[in] デバッグ用識別文字列
Returns
確保メモリ

◆ GX_ALLOCATE_MEMORY_TYPE_ALIGNMENT_NAME

#define GX_ALLOCATE_MEMORY_TYPE_ALIGNMENT_NAME ( allocator,
type,
size,
alignment,
name )
Value:
(allocator)->allocateMemory(type, size, alignment)

◆ GX_ALLOCATE_MEMORY_TYPE_NAME

#define GX_ALLOCATE_MEMORY_TYPE_NAME ( allocator,
type,
size,
name )
Value:
(allocator)->allocateMemory(type, size)

◆ GX_OPERATOR_NEW_DELETE

#define GX_OPERATOR_NEW_DELETE ( allcatorNumber)
Value:
void* operator new (size_t size) { return gx::core::GxAllocatorList::getAllocator(allcatorNumber)->allocateMemory(gx::core::GxAllocatorList::getType(allcatorNumber), (u32)size); } \
void operator delete (void* pAddress) { gx::core::GxAllocatorList::getAllocator(allcatorNumber)->freeMemory(pAddress); } \
void* operator new (size_t, void* where) { return (where); } \
void operator delete (void*, void*) {} \
/*private:*/ \
GX_DEPRECATED_BEGIN void* operator new[] (size_t size) GX_DEPRECATED_END { return gx::core::GxAllocatorList::getAllocator(allcatorNumber)->allocateMemory(gx::core::GxAllocatorList::getType(allcatorNumber), (u32)size); } \
GX_DEPRECATED_BEGIN void operator delete[] (void* pAddress) GX_DEPRECATED_END { gx::core::GxAllocatorList::getAllocator(allcatorNumber)->freeMemory(pAddress); } \
public:

◆ GX_OPERATOR_NEW_DELETE_USE_ARRAY

#define GX_OPERATOR_NEW_DELETE_USE_ARRAY ( allcatorNumber)
Value:
void* operator new (size_t size) { return gx::core::GxAllocatorList::getAllocator(allcatorNumber)->allocateMemory(gx::core::GxAllocatorList::getType(allcatorNumber), (u32)size); } \
void* operator new[] (size_t size) { return gx::core::GxAllocatorList::getAllocator(allcatorNumber)->allocateMemory(gx::core::GxAllocatorList::getType(allcatorNumber), (u32)size); } \
void operator delete (void* pAddress) { gx::core::GxAllocatorList::getAllocator(allcatorNumber)->freeMemory(pAddress); } \
void operator delete[] (void* pAddress) { gx::core::GxAllocatorList::getAllocator(allcatorNumber)->freeMemory(pAddress); } \
void* operator new (size_t, void* where) { return (where); } \
void operator delete (void*, void*) {}

◆ GX_REALLOC_MEMORY

#define GX_REALLOC_MEMORY ( pAddress,
size )
Value:
GxAllocatorList::getAllocator(pAddress)->reallocMemory((void*)(pAddress), size)
virtual void * reallocMemory(void *pAddress, u32 size)
メモリ割り当てサイズ変更
Definition GxAllocator.cpp:614
constexpr GxAllocator * getAllocator(void) const
アロケータメンバ取得
Definition GxAllocator.h:463

メモリ割り当てサイズ変更マクロ関数

Parameters
pAddress[in] 割り当てサイズ変更アドレス
size[in] 変更サイズ
name[in] デバッグ用識別文字列
Returns
変更後メモリアドレス (nullptrの場合:再確保失敗)

◆ GX_REALLOC_MEMORY_NAME

#define GX_REALLOC_MEMORY_NAME ( pAddress,
size,
name )
Value:
GxAllocatorList::getAllocator(pAddress)->reallocMemory((void*)(pAddress), size)

◆ GX_SAFE_FREE_MEMORY

#define GX_SAFE_FREE_MEMORY ( pAddress)
Value:
{ if( (pAddress) ) { GxAllocatorList::getAllocator((void*)(pAddress))->freeMemory((void*)(pAddress)); (pAddress) = nullptr; } }
virtual void freeMemory(void *pAddress)
メモリ解放
Definition GxAllocator.cpp:581

メモリ解放マクロ関数

Parameters
pAddress[in] 解放アドレス
name[in] デバッグ用識別文字列(トレース出力のみ)

◆ GX_SAFE_FREE_MEMORY_ALLOCATOR

#define GX_SAFE_FREE_MEMORY_ALLOCATOR ( pAddress,
allocator )
Value:
{ if( (pAddress) ) { (allocator)->freeMemory((void*)(pAddress)); (pAddress) = nullptr; } }

メモリ解放マクロ関数 (アロケータ指定)

Parameters
pAddress[in] 解放アドレス
allocator[in] アロケータポインタ
name[in] デバッグ用識別文字列(トレース出力のみ)

◆ GX_SAFE_FREE_MEMORY_ALLOCATOR_NAME

#define GX_SAFE_FREE_MEMORY_ALLOCATOR_NAME ( pAddress,
allocator,
name )
Value:
{ if( (pAddress) ) { (allocator)->freeMemory((void*)(pAddress)); (pAddress) = nullptr; } }

◆ GX_SAFE_FREE_MEMORY_NAME

#define GX_SAFE_FREE_MEMORY_NAME ( pAddress,
name )
Value:
{ if( (pAddress) ) { GxAllocatorList::getAllocator((void*)(pAddress))->freeMemory((void*)(pAddress)); (pAddress) = nullptr; } }