7 #ifndef __MEMORY_BLOCK_HEADER
8 #define __MEMORY_BLOCK_HEADER
45 tBool m_bProtectionField;
void tVoid
The tVoid is always the definition for the void (non-type).
int tInt
type definition for signed integer value (platform and compiler dependent type).
bool tBool
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent).
uint32_t tUInt32
type definition for unsigned integer values (32bit) (platform and compiler independent type).
size_t tSize
type definition for a array size values, map size values etc.
static tVoid MemCopy(tVoid *pDest, const tVoid *pSrc, tSize nCount)
Copies data from one buffer to another.
static tResult MemLockAll(tUInt32 nFlags)
Locks the whole virtual address area.
tResult Zero()
Sets all allocated bytes to zero.
static tUInt32 m_ui32Protector
Protector for debugging purposes.
static tVoid * AllocPageAlignedMemory(tSize nSize, tSize nPageSize=0)
use
tSize m_nSize
Size of buffer.
tResult Alloc(tSize nSize, tSize nAlignment, tUInt32 ui32Flags=0)
Allocates memory at addresses that are a multiple of an alignment value.
tResult Alloc(tSize nSize)
(Re)allocates memory
tResult Set(const tVoid *src, tSize nByteCount)
Copy data and adjust allocated memory size as necessary.
virtual ~cMemoryBlock()
Destructor.
tResult Resize(tSize nSize)
(Re)allocates memory
static tVoid MemZero(tVoid *pDest, tSize nCount)
Sets the data of a buffer to zero.
cMemoryBlock(const cMemoryBlock &oBlock)
Copy constructor.
cMemoryBlock(tSize nSize)
Constructor which preallocates memory.
static tInt MemCmp(const tVoid *pMem1, const tVoid *pMem2, tSize nCount)
Compares the data bytes of two memory buffers.
static tResult MemUnlockAll()
Unlocks all the virtual address areas previously locked by cMemoryBlock::MemLock or cMemoryBlock::Mem...
tVoid * GetPtr() const
Get a pointer to the allocated memory.
tVoid Free()
Frees all allocated memory.
tSize GetSize() const
Get the amount of allocated memory in bytes.
static tResult MemUnlock(const tVoid *pAddress, tSize nSize)
Unlocks part of the virtual address previously locked by cMemoryBlock::MemLock.
static tUInt32 m_ui32DefaultSectorSize
Default sector size.
tResult CopyTo(tVoid *dest) const
Copy data from the allocated memory into the provided destination buffer.
static tResult MemLock(const tVoid *pAddress, tSize nSize)
Locks part of the calling process's virtual address space into RAM preventing that memory from being ...
cMemoryBlock()
Default constructor.
tVoid * m_Ptr
Pointer to memory block.
tResult Swap(cMemoryBlock &refMemBlock)
Swaps the administrated memory between two memory blocks.
tVoid * m_pBuffer
Internal buffer.
static tVoid FreePageAlignedMemory(tVoid *pMemory)
use
static tVoid MemSet(tVoid *pDest, tInt nValue, tSize nCount)
Fills the data bytes of a buffer to the specified value.
A common result class usable as return value throughout.
#define A_UTILS_D(__pclassname_)
Helper macro for d-pattern definitions.
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.