orx 1.16
Portable Game Engine
Loading...
Searching...
No Matches
OrxBank

Macros

#define orxBANK_KU32_FLAG_NONE   0x00000000
#define orxBANK_KU32_FLAG_NOT_EXPANDABLE   0x00000001

Typedefs

typedef struct __orxBANK_t orxBANK

Functions

orxDLLAPI void *orxFASTCALL orxBank_Allocate (orxBANK *_pstBank)
orxDLLAPI void *orxFASTCALL orxBank_AllocateIndexed (orxBANK *_pstBank, orxU32 *_pu32ItemIndex, void **_ppPrevious)
orxDLLAPI void orxFASTCALL orxBank_Clear (orxBANK *_pstBank)
orxDLLAPI void orxFASTCALL orxBank_Compact (orxBANK *_pstBank)
orxDLLAPI void orxFASTCALL orxBank_CompactAll ()
orxDLLAPI orxBANK *orxFASTCALL orxBank_Create (orxU32 _u32Count, orxU32 _u32Size, orxU32 _u32Flags, orxMEMORY_TYPE _eMemType)
orxDLLAPI void orxFASTCALL orxBank_Delete (orxBANK *_pstBank)
orxDLLAPI void orxFASTCALL orxBank_Exit ()
orxDLLAPI void orxFASTCALL orxBank_Free (orxBANK *_pstBank, void *_pCell)
orxDLLAPI void orxFASTCALL orxBank_FreeAtIndex (orxBANK *_pstBank, orxU32 _u32Index)
orxDLLAPI void *orxFASTCALL orxBank_GetAtIndex (const orxBANK *_pstBank, orxU32 _u32Index)
orxDLLAPI orxU32 orxFASTCALL orxBank_GetCount (const orxBANK *_pstBank)
orxDLLAPI orxU32 orxFASTCALL orxBank_GetIndex (const orxBANK *_pstBank, const void *_pCell)
orxDLLAPI void *orxFASTCALL orxBank_GetNext (const orxBANK *_pstBank, const void *_pCell)
orxDLLAPI orxSTATUS orxFASTCALL orxBank_Init ()
orxDLLAPI void orxFASTCALL orxBank_Setup ()

Detailed Description

Bank module Bank are used to allocate some memory. Applications can get cell from this memory and use it. If the number of allocations requests become bigger than the bank size, a new segment of memory is automatically allocated. Memory bank can be used to try to reduce memory fragmentation.

Macro Definition Documentation

◆ orxBANK_KU32_FLAG_NONE

#define orxBANK_KU32_FLAG_NONE   0x00000000

No flags (default behaviour)

Definition at line 59 of file orxBank.h.

◆ orxBANK_KU32_FLAG_NOT_EXPANDABLE

#define orxBANK_KU32_FLAG_NOT_EXPANDABLE   0x00000001

The bank will not be expandable

Definition at line 60 of file orxBank.h.

Typedef Documentation

◆ orxBANK

typedef struct __orxBANK_t orxBANK

Definition at line 56 of file orxBank.h.

Function Documentation

◆ orxBank_Allocate()

orxDLLAPI void *orxFASTCALL orxBank_Allocate ( orxBANK * _pstBank)
extern

Allocates a new cell from the bank

Parameters
[in]_pstBankConcerned bank
Returns
a new cell of memory (orxNULL if no allocation possible)

◆ orxBank_AllocateIndexed()

orxDLLAPI void *orxFASTCALL orxBank_AllocateIndexed ( orxBANK * _pstBank,
orxU32 * _pu32ItemIndex,
void ** _ppPrevious )
extern

Allocates a new cell from the bank and returns its index

Parameters
[in]_pstBankConcerned bank
[out]_pu32ItemIndexWill be set with the allocated item index
[out]_ppPreviousIf non-null, will contain previous neighbor if found
Returns
a new cell of memory (orxNULL if no allocation possible)

◆ orxBank_Clear()

orxDLLAPI void orxFASTCALL orxBank_Clear ( orxBANK * _pstBank)
extern

Frees all allocated cell from a bank

Parameters
[in]_pstBankConcerned bank

◆ orxBank_Compact()

orxDLLAPI void orxFASTCALL orxBank_Compact ( orxBANK * _pstBank)
extern

Compacts a bank by removing all its trailing unused segments

Parameters
[in]_pstBankConcerned bank

◆ orxBank_CompactAll()

orxDLLAPI void orxFASTCALL orxBank_CompactAll ( )
extern

Compacts all banks by removing all their unused segments

◆ orxBank_Create()

orxDLLAPI orxBANK *orxFASTCALL orxBank_Create ( orxU32 _u32Count,
orxU32 _u32Size,
orxU32 _u32Flags,
orxMEMORY_TYPE _eMemType )
extern

Creates a memory bank

Parameters
[in]_u32CountNumber of cells per segments
[in]_u32SizeSize of a cell
[in]_u32FlagsBank flags
[in]_eMemTypeMemory type
Returns
orxBANK / orxNULL

◆ orxBank_Delete()

orxDLLAPI void orxFASTCALL orxBank_Delete ( orxBANK * _pstBank)
extern

Deletes a bank

Parameters
[in]_pstBankConcerned bank

◆ orxBank_Exit()

orxDLLAPI void orxFASTCALL orxBank_Exit ( )
extern

Exits from the bank module

◆ orxBank_Free()

orxDLLAPI void orxFASTCALL orxBank_Free ( orxBANK * _pstBank,
void * _pCell )
extern

Frees an allocated cell

Parameters
[in]_pstBankConcerned bank
[in]_pCellPointer to the cell to free

◆ orxBank_FreeAtIndex()

orxDLLAPI void orxFASTCALL orxBank_FreeAtIndex ( orxBANK * _pstBank,
orxU32 _u32Index )
extern

Frees an allocated cell at a given index

Parameters
[in]_pstBankConcerned bank
[in]_u32IndexIndex of the cell to free

◆ orxBank_GetAtIndex()

orxDLLAPI void *orxFASTCALL orxBank_GetAtIndex ( const orxBANK * _pstBank,
orxU32 _u32Index )
extern

Gets the cell at given index, orxNULL is the cell isn't allocated

Parameters
[in]_pstBankConcerned memory bank
[in]_u32IndexIndex of the cell to retrieve
Returns
The cell at the given index if allocated, orxNULL otherwise

◆ orxBank_GetCount()

orxDLLAPI orxU32 orxFASTCALL orxBank_GetCount ( const orxBANK * _pstBank)
extern

Gets the bank allocated cell count

Parameters
[in]_pstBankConcerned bank
Returns
Number of allocated cells

◆ orxBank_GetIndex()

orxDLLAPI orxU32 orxFASTCALL orxBank_GetIndex ( const orxBANK * _pstBank,
const void * _pCell )
extern

Gets the cell's index

Parameters
[in]_pstBankConcerned memory bank
[in]_pCellCell of which we want the index
Returns
The index of the given cell

◆ orxBank_GetNext()

orxDLLAPI void *orxFASTCALL orxBank_GetNext ( const orxBANK * _pstBank,
const void * _pCell )
extern

Gets the next cell

Parameters
[in]_pstBankConcerned bank
[in]_pCellPointer to the current cell of memory, orxNULL to get the first one
Returns
The next cell if found, orxNULL otherwise

◆ orxBank_Init()

orxDLLAPI orxSTATUS orxFASTCALL orxBank_Init ( )
extern

Inits the bank Module

Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

◆ orxBank_Setup()

orxDLLAPI void orxFASTCALL orxBank_Setup ( )
extern

Setups the bank module


Generated for orx by doxygen 1.8.11